Update from core and add tests #5
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: "All Pull Request Tests" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| tests: | |
| if: github.event.pull_request.draft == false | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| multisite: [true, false] | |
| php: [8.2, 8.3, 8.4] | |
| wordpress: ["latest"] | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite && '1' || '0' }} | |
| cancel-in-progress: true | |
| name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} ${{ matrix.multisite && 'Multisite' || '' }}" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup PHP with PECL extension | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '${{ matrix.php }}' | |
| - name: Install Composer | |
| run: | | |
| composer install | |
| cd tests && composer install | |
| - name: Validate Composer | |
| run: composer validate --strict | |
| - name: Run tests | |
| run: composer test | |
| # This required job ensures that all PR checks have passed before merging. | |
| all-pr-checks-passed: | |
| name: All PR checks passed | |
| needs: | |
| - tests | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check job statuses | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then | |
| echo "One or more jobs failed" | |
| exit 1 | |
| elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "One or more jobs were cancelled" | |
| exit 1 | |
| else | |
| echo "All jobs passed or were skipped" | |
| exit 0 | |
| fi |