-
Notifications
You must be signed in to change notification settings - Fork 7
83 lines (70 loc) · 2.41 KB
/
Copy pathe2e.yml
File metadata and controls
83 lines (70 loc) · 2.41 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
name: E2E
on:
workflow_dispatch:
push:
paths:
- 'tests/e2e/**'
- '.github/workflows/e2e.yml'
permissions:
contents: read
jobs:
e2e:
name: Playwright E2E (Pantheon multidev)
runs-on: ubuntu-latest
defaults:
run:
working-directory: tests/e2e
env:
TERMINUS_SITE: ${{ vars.E2E_TERMINUS_SITE }}
TERMINUS_SOURCE_ENV: ${{ vars.E2E_TERMINUS_SOURCE_ENV || 'dev' }}
TERMINUS_HIDE_UPDATE_MESSAGE: '1'
WP_USER: ${{ secrets.E2E_WP_USER }}
WP_PASSWORD: ${{ secrets.E2E_WP_PASSWORD }}
HEADLESS: 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up PHP (for Terminus)
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.3'
- name: Set up Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 20
- name: Install Terminus
run: |
curl -L https://github.com/pantheon-systems/terminus/releases/latest/download/terminus.phar -o /tmp/terminus
chmod +x /tmp/terminus
sudo mv /tmp/terminus /usr/local/bin/terminus
terminus --version
- name: Authenticate Terminus
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
run: terminus auth:login --machine-token="$TERMINUS_TOKEN"
- name: Configure SSH for Pantheon (git/SFTP)
env:
PANTHEON_SSH_KEY: ${{ secrets.PANTHEON_SSH_KEY }}
run: |
mkdir -p ~/.ssh
printf '%s\n' "$PANTHEON_SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Install dependencies
run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run E2E
run: npm test
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report
path: tests/e2e/playwright-report/
retention-days: 7
- name: Upload test results (screenshots, videos, traces)
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results
path: tests/e2e/test-results/
retention-days: 7