Skip to content

Update credits list for 14.0.0 release (trunk) #5

Update credits list for 14.0.0 release (trunk)

Update credits list for 14.0.0 release (trunk) #5

Workflow file for this run

name: Unit Tests
on:
pull_request:
paths-ignore:
- 'docs/**'
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
jobs:
tests:
name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
wp_version: ['master']
include:
- php: '8.0'
wp_version: 'latest'
- php: '7.4'
wp_version: 'latest'
- php: '7.4'
wp_version: '6.1'
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp_version }}
steps:
- name: Cancel previous runs of this workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Check Gitignored files
run: if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, imagick, mysql, zip
coverage: none
tools: composer:v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '>=20.10.0'
- name: Log information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
npm --version
node --version
git --version
php --version
composer --version
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- 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: |
if [ ${{ env.WP_VERSION }} == 'latest' ]; then
echo "{\"core\":null}" >> .wp-env.override.json
else
echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json
fi
- name: Install WordPress
run: |
chmod -R 767 ./
npm run wp-env start -- --update
- name: Running single site unit tests
if: ${{ success() || failure() }}
run: npm run test-php
- name: Running multi site unit tests
if: ${{ success() || failure() }}
run: npm run test-php-multisite
- name: Stop Docker environment
if: ${{ success() || failure() }}
run: npm run wp-env stop