Skip to content

[pull] main from GatherPress:main #240

[pull] main from GatherPress:main

[pull] main from GatherPress:main #240

Workflow file for this run

name: PHPUnit Tests
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/phpunit-tests.yml'
- 'includes/**'
- 'test/unit/php**'
- '*.php'
- 'phpunit.xml.dist'
- 'composer.*'
jobs:
test-php:
name: ${{ matrix.php_versions }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
php_versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_versions }}
coverage: xdebug
- name: Composer Install
run: composer install --optimize-autoloader --prefer-dist
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# Enable built-in functionality for caching and restoring dependencies, which is disabled by default.
# The actions/setup-node uses actions/cache under the hood.
# https://github.com/actions/setup-node#caching-global-packages-data
cache: 'npm'
- name: Log debug information
run: |
npm --version
node --version
git --version
php --version
composer --version
- name: Running PHPUnit Tests
run: |
php --version
npm i -g @wordpress/env
npm run test:unit:php
if: ${{ success() || failure() }}