Skip to content

Update v3

Update v3 #34

Workflow file for this run

name: Unit Tests
# Since Unit Tests are required to pass for each PR,
# we cannot disable them for documentation-only changes.
on:
pull_request:
push:
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
test-php:
name: PHP ${{ matrix.php }}${{ matrix.wordpress != '' && format( ' (WP {0}) ', matrix.wordpress ) || '' }} on ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
wordpress:
- '6.5'
- '6.7'
- '6.8'
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_ENV_CORE: ${{ matrix.wordpress == '' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }}
steps:
- uses: actions/[email protected]
- name: Install Dependencies
run: npm ci
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl
- name: Install PHP Dependencies
run: composer install --no-interaction --no-progress --no-suggest --optimize-autoloader
- name: Docker debug information
run: |
docker -v
- name: General debug information
run: |
npm --version
node --version
php --version
curl --version
git --version
locale -a
echo "PHP version: ${WP_ENV_PHP_VERSION}"
echo "WordPress version: ${WP_ENV_CORE}"
- name: Start Docker environment
run: npm run wp-env start
- name: Log running Docker containers
run: docker ps -a
- name: Running unit tests
run: |
set -o pipefail
npm run test