Skip to content

Commit

Permalink
Update unit-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Jan 27, 2025
1 parent 7b02eb3 commit 92971e2
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- php: '8.2'
wp: 'latest'
experimental: true
- php: '8.4'
wp: 'latest'
- php: '8.2'
wp: '6.3'
experimental: true
- php: '8.0'
wp: '5.9'
Expand Down Expand Up @@ -71,23 +71,18 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpunit-polyfills
extensions: mysqli, mysql
coverage: none
# The PHP 5.6 and 7.0 images don't include mysql[i] by default.
extensions: mysqli

- name: Set up WordPress
run: phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}

# On WP 5.2, PHPUnit 5.x, 6.x and 7.x are supported.
# On PHP >= 8.0, PHPUnit 7.5+ is needed, no matter what.
- name: Determine supported PHPUnit version
id: set_phpunit
run: |
if [[ "${{ matrix.php }}" > "7.4" ]]; then
echo "PHPUNIT=8.5.*" >> $GITHUB_ENV
if [[ "${{ matrix.php }}" > "8.0" ]]; then
echo "PHPUNIT=9.*" >> $GITHUB_ENV
else
echo "PHPUNIT=5.7.*||6.*||7.5.*" >> $GITHUB_ENV
echo "PHPUNIT=5.7.*||6.*||7.5.*||8.5.*" >> $GITHUB_ENV
fi
- name: 'Composer: set up PHPUnit'
Expand All @@ -108,21 +103,23 @@ jobs:
with:
composer-options: --ignore-platform-reqs

- name: 'Run Composer Update'
run: |
composer update --ignore-platform-reqs
- name: Install Subversion
run: sudo apt-get install subversion

- name: Set up WordPress
run: phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}

- name: Tool versions
run: |
php --version
composer --version
phpunit --version
which phpunit
./vendor/bin/phpunit --version
which ./vendor/bin/phpunit
- name: Run the unit tests - single site
run: vendor/bin/phpunit
run: ./vendor/bin/phpunit

- name: Run the unit tests - multisite
run: vendor/bin/phpunit
env:
WP_MULTISITE: 1
run: ./vendor/bin/phpunit

0 comments on commit 92971e2

Please sign in to comment.