Skip to content

Update to PHP 8.4 and use wp-env for CI tests #1139

Update to PHP 8.4 and use wp-env for CI tests

Update to PHP 8.4 and use wp-env for CI tests #1139

Workflow file for this run

name: Tests
on:
pull_request:
types: [ opened, synchronize ]
jobs:
phpunit:
name: PHPUnit ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.4', '8.5' ]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: 'none'
tools: composer
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--no-progress --no-ansi --no-interaction"
- name: Install wp-env
run: npm -g install @wordpress/env --force
- name: Override PHP version
run: echo '{ "phpVersion":"${{ matrix.php }}" }' > .wp-env.override.json
- name: Start wp-env
run: wp-env start
- name: Run tests
run: wp-env run tests-cli --env-cwd=wp-content/plugins/wporg-gp-translation-events ./vendor/bin/phpunit