-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (56 loc) · 1.56 KB
/
phpunit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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@v41
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'