generated from jrtashjian/pluginwp
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.36 KB
/
unit-test.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
name: Unit Tests
on:
pull_request:
jobs:
test-php:
name: PHP ${{matrix.php}}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.wordpress != '' && format( ' (WP {0}) ', matrix.wordpress ) || '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
multisite: [false]
wordpress: ["6.4","6.3"]
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_ENV_CORE: ${{ format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }}
steps:
- uses: actions/checkout@v3
- name: Restore npm dependency cache
uses: ./.github/actions/restore-npm-cache
- run: npm install
- name: Build scripts
run: npm run build
- name: Install PHP-Scoper
run: composer global require humbug/php-scoper
- name: Add Composer bin to PATH
run: echo "$HOME/.composer/vendor/bin/" >> $GITHUB_PATH
- name: Run PHP-Scoper
run: composer run phpscoper
- name: Install composer dependencies
run: composer install
- name: Start Docker environment
run: npm run wp-env start
- name: Running single site unit tests
if: ${{ ! matrix.multisite }}
run: |
set -o pipefail
npm run test:unit:php:base | tee phpunit.log