-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (73 loc) · 2.49 KB
/
tests.yml
File metadata and controls
87 lines (73 loc) · 2.49 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: E2E Tests
on:
workflow_call:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-matrix:
name: Prepare test matrix
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
- name: Checkout plugin
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Build dynamic WordPress + PHP matrix
id: build-matrix
shell: bash
run: |
set -euo pipefail
matrix="$(python3 scripts/get-wordpress-matrix.py)"
echo "Using matrix: ${matrix}"
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
e2e:
needs: prepare-matrix
name: WP ${{ matrix.wp }} / PHP ${{ matrix.php }}
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare-matrix.outputs.matrix) }}
steps:
- name: Checkout plugin
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: "pnpm"
- name: Install pnpm dependencies
run: pnpm install
- name: Set WordPress and PHP version override
run: |
echo '{
"core": "https://wordpress.org/wordpress-${{ matrix.wp }}.zip",
"phpVersion": "${{ matrix.php }}"
}' > .wp-env.override.json
- name: Start wp-env
run: pnpm exec wp-env start
- name: Install Playwright browsers
run: pnpm run tests:install
- name: Run Playwright tests
run: pnpm exec playwright test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-php${{ matrix.php }}-wp${{ matrix.wp }}
path: test-results
if-no-files-found: ignore
retention-days: 30