-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (63 loc) · 1.96 KB
/
run-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test
on:
pull_request:
push:
branches:
- main
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.4'
wp: WordPress
- php: '7.4'
wp: WordPress#6.4.3
- php: '8.0'
wp: WordPress
- php: '8.0'
wp: WordPress#6.4.3
- php: '8.2'
wp: WordPress
- php: '8.2'
wp: WordPress#6.4.3
name: PHP ${{ matrix.php }} / ${{ matrix.wp }} Test
steps:
- uses: actions/checkout@v4
- name: Use desired version of Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Npm install and build
run: |
npm ci
npm run build
- name: Composer install and set phpcs
run: |
composer install
composer phpcs
- name: Running lint check
run: npm run lint
- name: Install Playwright dependencies
run: npx playwright install chromium firefox webkit --with-deps
- name: Install WordPress
run: |
WP_ENV_CORE=WordPress/${{ matrix.wp }} WP_ENV_PHP_VERSION=${{ matrix.php }} npm run wp-env start
npm run wp-env run cli wp core version
npm run wp-env run cli wp cli info
- name: Running e2e tests
run: npm run test:e2e
- name: Archive debug artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: failures-artifacts-${{ matrix.php }}-${{ matrix.wp }}
path: artifacts
if-no-files-found: ignore