Fix test for checking output from defaults #9
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: Run Plugin Tests | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] | |
| wp-version: [ '6.4', '6.5', '6.6', '6.7', '6.8' ] | |
| exclude: | |
| - php-version: '8.4' | |
| wp-version: '6.4' | |
| - php-version: '8.4' | |
| wp-version: '6.5' | |
| - php-version: '8.4' | |
| wp-version: '6.6' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '7.4' | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-interaction --no-progress | |
| - name: Write .wp-env.override.json | |
| run: | | |
| echo '{' > .wp-env.override.json | |
| echo ' "core": "WordPress/WordPress#${{ matrix.wp-version }}",' >> .wp-env.override.json | |
| echo ' "phpVersion": "${{ matrix.php-version }}"' >> .wp-env.override.json | |
| echo '}' >> .wp-env.override.json | |
| - name: Run wp-env and PHPUnit tests | |
| run: | | |
| npm run env:start | |
| npm run test | |
| - name: Stop wp-env | |
| if: always() | |
| run: npm run env:stop |