chore(ci): bump actions/checkout from 7.0.0 to 7.0.1 #91
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PHP CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/php/**' | |
| - '.github/workflows/php-ci.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'packages/php/**' | |
| - '.github/workflows/php-ci.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: PHP ${{ matrix.php }} (${{ matrix.deps }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.2', '8.3', '8.4'] | |
| deps: ['core', 'full'] | |
| defaults: | |
| run: | |
| working-directory: packages/php | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: json, simplexml, libxml | |
| coverage: pcov | |
| - name: Get Composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: php-${{ matrix.php }}-${{ matrix.deps }}-composer-${{ hashFiles('packages/php/composer.lock') }} | |
| restore-keys: php-${{ matrix.php }}-${{ matrix.deps }}-composer- | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist ${{ matrix.deps == 'core' && '--no-dev' || '' }} | |
| - name: Run tests | |
| if: matrix.deps == 'full' | |
| run: vendor/bin/pest --coverage --coverage-clover coverage.xml --min=95 | |
| - name: Upload coverage to Codecov | |
| if: matrix.php == '8.4' && matrix.deps == 'full' | |
| uses: ./.github/actions/upload-coverage | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: php | |
| files: packages/php/coverage.xml | |
| - name: Run PHPStan | |
| if: matrix.deps == 'full' && matrix.php == '8.4' | |
| run: vendor/bin/phpstan analyse | |
| - name: Check code style | |
| if: matrix.deps == 'full' && matrix.php == '8.4' | |
| run: vendor/bin/php-cs-fixer fix --dry-run --diff | |
| # Cross-parity ensures PHP and JS produce identical results | |
| - name: Cross-parity tests | |
| if: matrix.deps == 'full' && matrix.php == '8.4' | |
| run: composer test:parity | |
| - name: Mutation tests (MSI = 85%) | |
| if: matrix.deps == 'full' && matrix.php == '8.4' | |
| run: bash scripts/mutation.sh | |
| - name: Update Infection MSI badge (Gist) | |
| if: matrix.deps == 'full' && matrix.php == '8.4' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| env: | |
| GIST_TOKEN: ${{ secrets.GIST_TOKEN }} | |
| working-directory: packages/php | |
| run: | | |
| MSI=$(python3 -c "import json,sys; d=json.load(open('build/infection/infection.json')); print(d['stats']['msi'])") | |
| if python3 -c "import sys; sys.exit(0 if float('$MSI') >= 90 else 1)"; then COLOR="brightgreen" | |
| elif python3 -c "import sys; sys.exit(0 if float('$MSI') >= 85 else 1)"; then COLOR="green" | |
| elif python3 -c "import sys; sys.exit(0 if float('$MSI') >= 75 else 1)"; then COLOR="yellow" | |
| else COLOR="red"; fi | |
| curl -s -X PATCH \ | |
| -H "Authorization: token $GIST_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"files\":{\"infection-msi.json\":{\"content\":\"{\\\"schemaVersion\\\":1,\\\"label\\\":\\\"Infection MSI\\\",\\\"message\\\":\\\"${MSI}%\\\",\\\"color\\\":\\\"${COLOR}\\\"}\"}}}"\ | |
| "https://api.github.com/gists/80c602b17107f88fb17794d4d44c94fa" |