-
-
Notifications
You must be signed in to change notification settings - Fork 7
111 lines (92 loc) · 3.33 KB
/
e2e.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: E2E Testing
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: none
jobs:
e2e:
name: "Run E2E tests (use wordpress:${{ matrix.wordpress }} image)"
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
wordpress:
- php7.4
- php8.0
- php8.1
- php8.2
- beta-php7.4
- beta-php8.0
- beta-php8.1
- beta-php8.2
steps:
- name: Checkout source code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Set up PHP
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # 2.30.4
- name: Install Composer Dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0
- name: Install Playwright
run: npx playwright install chromium
- name: Run Playwright E2E tests
run: npm run test:e2e
env:
WP_VERSION: ${{ matrix.wordpress }}
- name: Upload test results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: failure()
with:
name: playwright-test-results-${{ matrix.wordpress }}
path: test-results/
retention-days: 3
e2e-bundle:
name: Run E2E tests on the generated plugin
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Generate self-contained package
run: |
git archive --format=tar --prefix=two-factor-provider-webauthn/ HEAD | (cd /var/tmp/ && tar xf -)
(cd /var/tmp/two-factor-provider-webauthn && composer install --no-dev --no-interaction && composer remove --update-no-dev --no-interaction composer/installers cweagans/composer-patches && rm -rf composer.lock composer.json patches vendor/madwizard/webauthn/.github vendor/madwizard/webauthn/conformance vendor/madwizard/webauthn/tests vendor/psr/log/Psr/Log/Test vendor/psr/http-message/docs vendor/typisttech)
- name: Patch docker-compose.yml
run: |
sed -i 's!- .:!- /var/tmp/two-factor-provider-webauthn:!' docker-compose.yml
- name: Set up Node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install chromium
- name: Run Playwright E2E tests
run: npm run test:e2e
env:
WP_VERSION: php8.1
- name: Upload test results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: failure()
with:
name: playwright-test-results-bundle
path: test-results/
retention-days: 3