Bump version to 0.9.1 #36
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.2', '7.4', '8.0', '8.1'] | |
wp_version: ['5.9', '6.0', '6.1', '6.2', '6.3', 'master'] | |
include: | |
- php: '7.2' | |
wp_version: '5.1' | |
- php: '7.2' | |
wp_version: '5.8' | |
- php: '7.4' | |
wp_version: '5.8' | |
- php: '8.0' | |
wp_version: '5.8' | |
- php: '8.2' | |
wp_version: '6.1' | |
- php: '8.2' | |
wp_version: '6.2' | |
- php: '8.2' | |
wp_version: 'master' | |
env: | |
WP_ENV_PHP_VERSION: ${{ matrix.php }} | |
WP_VERSION: ${{ matrix.wp_version }} | |
# 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 }} == '5.1' ]; then composer require --dev --with-all-dependencies "wp-phpunit/wp-phpunit:5.1.*" "phpunit/phpunit:^6"; 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() }} |