PHP Quality Tests #969
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 Quality Tests | |
| on: | |
| pull_request: | |
| workflow_run: | |
| workflows: ["Update WP Deps"] | |
| types: | |
| - completed | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| contents: write | |
| checks: write | |
| statuses: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ | |
| 8.1, | |
| 8.2, | |
| 8.3 | |
| ] | |
| name: Test PHP ${{ matrix.php }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| if: github.event_name != 'workflow_run' | |
| - name: Checkout | |
| uses: boxuk/checkout-pr@main | |
| id: checkout-deps | |
| if: github.event_name == 'workflow_run' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| job-name: Test PHP ${{ matrix.php }} | |
| - name: Set up PHP | |
| uses: setup-php/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: pcov | |
| tools: cs2pr | |
| extensions: sqlsrv, pdo_sqlsrv | |
| - name: Setup Composer Auth | |
| run: composer config -g github-oauth.github.com $GITHUB_TOKEN | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: composer install | |
| - name: Run lint | |
| run: composer run phpcs -- -q --report=checkstyle | cs2pr | |
| - name: Run tests | |
| run: composer run phpunit | |
| - name: Run static analysis | |
| run: composer run phpstan -- --error-format=checkstyle --memory-limit=1G | cs2pr | |
| - name: Run coverage-check | |
| run: composer run coverage-check | |
| - name: Mark Check Outcome | |
| if: github.event_name == 'workflow_run' && always() | |
| uses: boxuk/mark-check-status@main | |
| with: | |
| status: ${{ job.status }} | |
| pr-head-sha: ${{ steps.checkout-deps.outputs.pr-head-sha }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| job-name: Test PHP ${{ matrix.php }} | |