diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2dc42a7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +# Cancel superseded runs on the same ref. +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + ci: + name: make ci (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.4'] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + # PCOV drives Infection's coverage in `make test/mutation`. + coverage: pcov + extensions: mbstring + tools: composer:v2 + + - name: Validate composer.json + run: composer validate --strict + + - name: Resolve Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + + - name: Cache Composer packages + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ matrix.php }}-${{ hashFiles('composer.json') }} + restore-keys: composer-${{ matrix.php }}- + + - name: Install dependencies + run: composer install --no-interaction --no-progress --prefer-dist + + - name: Run the full quality gate + # check -> build -> unit -> PHPStan (L9) -> mutation (100% MSI) -> demo + run: make ci diff --git a/composer.json b/composer.json index 57a7bf9..b586cf1 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "source": "https://github.com/xphp-lang/collections" }, "require": { - "php": "^8.3" + "php": "^8.4.0" }, "require-dev": { "xphp-lang/xphp": "0.3.0",