Clear out PHPUnit_Upgrade_Warning #3636
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 | |
| - '*.x' | |
| - '*.*.x' | |
| pull_request: | |
| jobs: | |
| monorepo-validate: | |
| if: github.event.pull_request.draft == false | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| name: "Composer and Monorepo Validate" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run General Tests | |
| uses: alleyinteractive/action-test-general@develop | |
| - name: Run Linter | |
| uses: alleyinteractive/action-test-php@develop | |
| with: | |
| php-version: '8.4' | |
| skip-services: 'true' | |
| skip-wordpress-install: 'true' | |
| test-command: 'composer validate --strict && composer monorepo-validate' | |
| - name: Get all packages | |
| id: output_data | |
| run: echo "matrix=$(vendor/bin/monorepo-builder packages-json | jq -c .)" >> $GITHUB_OUTPUT | |
| - name: Validate all packages | |
| run: | | |
| original_dir=$(pwd) | |
| for package in $(echo '${{ steps.output_data.outputs.matrix }}' | jq -r '.[]'); do | |
| echo "Validating package: $package" | |
| cd "$original_dir/src/mantle/$package" || exit 1 | |
| composer install --no-interaction --no-progress --no-plugins --prefer-dist | |
| composer validate --strict | |
| composer audit --no-dev --locked --ansi --no-interaction | |
| done | |
| lint-tests: | |
| if: github.event.pull_request.draft == false | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| name: "Lint Tests" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run General Tests | |
| uses: alleyinteractive/action-test-general@develop | |
| - name: Run Linter | |
| uses: alleyinteractive/action-test-php@develop | |
| with: | |
| php-version: '8.4' | |
| skip-services: 'true' | |
| skip-wordpress-install: 'true' | |
| test-command: 'composer lint' | |
| get-versions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| versions: ${{ steps.wp-versions.outputs.versions }} | |
| steps: | |
| - name: Get WordPress Versions | |
| id: wp-versions | |
| uses: alleyinteractive/action-get-wordpress-versions@develop | |
| with: | |
| number: 4 | |
| unit-tests: | |
| if: github.event.pull_request.draft == false | |
| needs: get-versions | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dependencies: ["prefer-lowest", "prefer-stable"] | |
| multisite: [true, false] | |
| php: [8.2, 8.3, 8.4] | |
| wordpress: ${{fromJson(needs.get-versions.outputs.versions)}} | |
| exclude: | |
| - php: 8.4 | |
| dependencies: "prefer-lowest" | |
| - php: 8.4 | |
| wordpress: "6.6" | |
| - php: 8.4 | |
| wordpress: "6.6" | |
| - php: 8.4 | |
| wordpress: "6.5" | |
| # Test various older versions of WordPress in a limited capacity. | |
| # include: | |
| # - php: 8.3 | |
| # wordpress: "6.5" | |
| # dependencies: "prefer-stable" | |
| # multisite: true | |
| # - php: 8.3 | |
| # wordpress: "6.6" | |
| # dependencies: "prefer-stable" | |
| # multisite: true | |
| # - php: 8.3 | |
| # wordpress: "6.7" | |
| # dependencies: "prefer-stable" | |
| # multisite: true | |
| 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' }}-D${{ matrix.dependencies }} | |
| cancel-in-progress: true | |
| name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} ${{ matrix.multisite && 'Multisite' || '' }} Dependencies ${{ matrix.dependencies }}" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run PHP Tests | |
| uses: alleyinteractive/action-test-php@develop | |
| with: | |
| install-command: composer update --${{ matrix.dependencies }} --prefer-dist --no-interaction --no-progress | |
| php-version: '${{ matrix.php }}' | |
| skip-wordpress-install: 'true' | |
| test-command: 'composer phpunit' | |
| wordpress-host: 'false' | |
| wordpress-multisite: '${{ matrix.multisite }}' | |
| wordpress-version: '${{ matrix.wordpress }}' | |
| parallel-unit-tests: | |
| if: github.event.pull_request.draft == false | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.3, 8.4] | |
| wordpress: ["latest"] | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: parallel-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }} | |
| cancel-in-progress: true | |
| name: "Parallel PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run PHP Tests | |
| uses: alleyinteractive/action-test-php@develop | |
| with: | |
| install-command: 'composer require --dev --no-update brianium/paratest && composer update --prefer-dist --no-interaction --no-progress' | |
| php-version: '${{ matrix.php }}' | |
| skip-wordpress-install: 'true' | |
| test-command: 'WP_PHPUNIT_PATH=vendor/bin/paratest ./vendor/bin/paratest' | |
| wordpress-host: 'false' | |
| wordpress-multisite: 'true' | |
| wordpress-version: '${{ matrix.wordpress }}' | |
| # This required job ensures that all PR checks have passed before merging. | |
| all-pr-checks-passed: | |
| name: All PR checks passed | |
| needs: | |
| - monorepo-validate | |
| - lint-tests | |
| - unit-tests | |
| - parallel-unit-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 |