Skip to content

Merge pull request #275 from 10up/update/wp-version #487

Merge pull request #275 from 10up/update/wp-version

Merge pull request #275 from 10up/update/wp-version #487

Workflow file for this run

name: PHPUnit
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
check-diffs:
runs-on: ubuntu-latest
outputs:
has_changed: ${{ steps.files-changed.outputs.RSA_PHP_FILES_CHANGED }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get updated PHP files
id: changed-files
uses: tj-actions/changed-files@v32
with:
files: |
**/*.php
- id: files-changed
run: |
if [[ ( "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ) || "${{ github.event_name }}" == "push" ]]; then
echo "RSA_PHP_FILES_CHANGED=yes" >> $GITHUB_OUTPUT
fi
phpunit:
runs-on: ubuntu-latest
needs: check-diffs
if: needs.check-diffs.outputs.has_changed == 'yes'
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: getong/[email protected]
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install
- name: install node v16
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm i && npm run build
- name: Setup WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1
- name: PHPUnit
run: './vendor/bin/phpunit'