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 the unit tests for the lowest and latest versions of wp/php #63

Merged
merged 13 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
51 changes: 24 additions & 27 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,47 @@ concurrency:
cancel-in-progress: true

jobs:
build:
test:
# Alias 'master' to 'latest'
name: WP ${{ matrix.wp == 'master' && 'latest' || matrix.wp }} and PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}

strategy:
fail-fast: false
matrix:
php-versions:
- 8.0

env:
DB_DATABASE: test_db
DB_USER: root
DB_PASSWORD: root
include:
# Check lowest supported WP version, with the lowest supported PHP.
- php: "8.0"
wp: "6.0"
allowed_failure: false
# Check latest WP with the highest supported PHP.
- php: "latest"
wp: "master"
allowed_failure: false

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Install wordpress environment
run: npm -g install @wordpress/env

- name: Setup PHP
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
php-version: ${{ matrix.php-versions }}

- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
composer-options: --prefer-dist --no-progress

- name: Setup the wordpress environment
- name: Setup wp-env
run: wp-env start
env:
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wp }}

- name: PHPUnit
run: composer test
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"mnsami/composer-custom-directory-installer": false
},
"platform": {
"php": "8.0.2"
},
"sort-packages": true
}
}
Loading
Loading