Bump version to 1.9.1 #125
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
# This is a basic workflow to help you get started with Actions | |
name: PHPUnit Tests | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the develop branch | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
tests: | |
name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}" | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['7.4', '8.0', '8.1', '8.2', '8.3'] | |
wp_version: ['5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', 'master'] | |
include: | |
- php: '7.2' | |
wp_version: '5.4' | |
- php: '7.4' | |
wp_version: '5.5' | |
- php: '7.4' | |
wp_version: '5.8' | |
env: | |
WP_ENV_PHP_VERSION: ${{ matrix.php }} | |
WP_VERSION: ${{ matrix.wp_version }} | |
WP_PHPUNIT_DEFAULT_VERSION: '6.6' | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Cancel previous runs of this workflow | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
coverage: none | |
- name: Log information | |
run: | | |
echo "$GITHUB_REF" | |
echo "$GITHUB_EVENT_NAME" | |
npm --version | |
node --version | |
git --version | |
php --version | |
composer --version | |
- name: Validate Composer | |
run: composer validate --strict | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v1 | |
with: | |
composer-options: "--ignore-platform-reqs" | |
- name: Adjust phpunit/wp-phpunit version | |
run: | | |
if [[ '${{ env.WP_VERSION }}' == 'master' ]]; then | |
composer require --dev --with-all-dependencies "wp-phpunit/wp-phpunit:${{ env.WP_PHPUNIT_DEFAULT_VERSION }}.*"; | |
elif (( $(echo "${{ env.WP_VERSION }} < 5.9" | bc -l) )); then | |
composer require --dev --with-all-dependencies "wp-phpunit/wp-phpunit:${{ env.WP_VERSION }}.*" "phpunit/phpunit:^7"; | |
else | |
composer require --dev --with-all-dependencies "wp-phpunit/wp-phpunit:${{ env.WP_VERSION }}.*"; | |
fi | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Validate node modules | |
run: if [[ -f package.json ]]; then npm audit --audit-level=high --production --cache ~/.npm; fi | |
- name: Install node modules | |
run: npm ci --cache ~/.npm | |
- name: Setup WordPress | |
run: echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json | |
- name: Install WordPress | |
run: | | |
chmod -R 767 ./ | |
npm run wp-env start -- --update | |
- name: Running single site unit tests | |
run: npm run test-php | |
if: ${{ success() || failure() }} | |
- name: Stop Docker environment | |
run: npm run wp-env stop | |
if: ${{ success() || failure() }} |