Improve searchability with keywords #8
This file contains 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: Unit Tests | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test-php: | |
name: PHP ${{matrix.php}}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.wordpress != '' && format( ' (WP {0}) ', matrix.wordpress ) || '' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: | |
- "7.4" | |
- "8.0" | |
- "8.1" | |
- "8.2" | |
multisite: [false] | |
wordpress: ["6.3","6.2"] | |
env: | |
WP_ENV_PHP_VERSION: ${{ matrix.php }} | |
WP_ENV_CORE: ${{ format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore npm dependency cache | |
uses: ./.github/actions/restore-npm-cache | |
- name: Build scripts | |
run: npm run build | |
- name: Install PHP-Scoper | |
run: composer global require humbug/php-scoper | |
- name: Add Composer bin to PATH | |
run: echo "$HOME/.composer/vendor/bin/" >> $GITHUB_PATH | |
- name: Run PHP-Scoper | |
run: composer run phpscoper | |
- name: Install composer dependencies | |
run: composer install | |
- name: Start Docker environment | |
run: npm run wp-env start | |
- name: Running single site unit tests | |
if: ${{ ! matrix.multisite }} | |
run: | | |
set -o pipefail | |
npm run test:unit:php:base | tee phpunit.log |