Migrate integration tests to use wp-env #129
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: Run PHPUnit | |
| on: | |
| # Prevent the "push" build from running when there are only irrelevant changes. | |
| push: | |
| paths-ignore: | |
| - "**.md" | |
| jobs: | |
| test: | |
| name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.allowed_failure }} | |
| env: | |
| WP_VERSION: ${{ matrix.wordpress }} | |
| strategy: | |
| matrix: | |
| include: | |
| # Check lowest supported WP version, with the lowest supported PHP. | |
| - wordpress: '5.9' | |
| php: '7.4' | |
| allowed_failure: false | |
| # Check latest WP release with the highest supported PHP. | |
| - wordpress: '6.8' | |
| php: 'latest' | |
| allowed_failure: false | |
| # Check upcoming WP (master is the development branch). | |
| - wordpress: 'master' | |
| php: 'latest' | |
| allowed_failure: true | |
| # Check upcoming PHP - only needed when a new version has been forked (typically Sep-Nov) | |
| # - wordpress: 'trunk' | |
| # php: 'nightly' | |
| # allowed_failure: true | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install wordpress environment | |
| run: npm -g install @wordpress/env | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer | |
| - name: Install Composer dependencies | |
| uses: ramsey/composer-install@v3 | |
| with: | |
| composer-options: "${{ matrix.composer-options }}" | |
| - name: Setup problem matchers for PHP | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
| - name: Setup Problem Matchers for PHPUnit | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Setup wp-env | |
| run: wp-env start | |
| env: | |
| WP_ENV_CORE: WordPress/WordPress#${{ matrix.wordpress }} | |
| - name: Run integration tests (single site) | |
| run: composer test-integration | |
| - name: Run integration tests (multisite) | |
| run: composer test-integration-ms |