Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unit tests in different PHP version #15

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,56 @@ on:
- reopened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
php-test:
name: PHP
name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}${{ matrix.experimental && ' (experimental)' || '' }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
php:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
wordpress: [ 'latest' ]
include:
- php: '8.2'
wordpress: 'trunk'
experimental: true
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_ENV_CORE: ${{ matrix.wordpress == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }}
steps:
- uses: styfle/[email protected]
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm

- name: npm install
run: npm ci

- name: Install WordPress
run: npm run wp-env start
- name: Running single site unit tests

- name: Running php unit tests
run: npm run test-php

- name: Running multisite unit tests
run: npm run test-php-multisite
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"squizlabs/php_codesniffer": "^3.5",
"szepeviktor/phpstan-wordpress": "^1.3.0",
"wp-coding-standards/wpcs": "^3.0.0",
"wp-phpunit/wp-phpunit": "^5.8",
"wp-phpunit/wp-phpunit": "^6.1",
"yoast/phpunit-polyfills": "^1.0",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
Expand Down
52 changes: 28 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.