Skip to content

Commit

Permalink
Update actions to test new unit test set up
Browse files Browse the repository at this point in the history
  • Loading branch information
freibergergarcia committed Feb 10, 2024
1 parent 4a9426c commit 9217896
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 39 deletions.
62 changes: 23 additions & 39 deletions .github/workflows/run-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,37 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
php-test:
name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}${{ matrix.experimental && ' (experimental)' || '' }}
build:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
wordpress: [ 'latest' ]
experimental: [false]
include:
- php: '8.0'
wordpress: '6.1'
- php: '8.2'
wordpress: 'trunk'
experimental: true
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_ENV_CORE: ${{ matrix.wordpress == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }}
continue-on-error: ${{ matrix.experimental == true }}

steps:
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v2

- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: npm

- name: npm install
run: npm ci
- name: Install NPM Dependencies
run: npm install

- name: Install WordPress
run: npm run wp-env start
- name: Start WordPress Environment
run: npm run start-env

- name: Running PHPUnit tests
- name: Run PHPUnit Tests
run: npm run test-php

- name: Running PHPUnit tests for multisite
run: npm run test-php-multisite
- name: Stop WordPress Environment
run: npm run stop-env

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: composer:v2

- name: Install Composer Dependencies
run: composer install --no-progress

- name: Run PHP CodeSniffer
run: ./vendor/bin/phpcs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage.xml
*.txt
node_modules/
package-lock.json
.idea

0 comments on commit 9217896

Please sign in to comment.