forked from opengovsg/FormSG
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (124 loc) · 3.72 KB
/
Copy pathplaywright.yml
File metadata and controls
127 lines (124 loc) · 3.72 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Playwright Tests
env:
NODE_VERSION: '22.22'
PNPM_VERSION: '10.30.3'
on:
push:
branches-ignore:
- stg
- stg-alt
- stg-alt2
- stg-alt3
- uat
pull_request:
types: [opened, reopened]
branches-ignore:
- stg
- stg-alt
- stg-alt2
- stg-alt3
- uat
jobs:
setup:
timeout-minutes: 10
runs-on: ubuntu-latest
env:
AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE: 1
DD_TAGS: layer:e2e
steps:
- uses: actions/checkout@v4.3.1
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: pnpm install
- name: Build
env:
NODE_OPTIONS: --max-old-space-size=4096
VITE_APP_FORMSG_SDK_MODE: 'test'
run: pnpm build:sdk && pnpm --filter formsg-shared --filter formsg-monorepo build
- name: Cache build artifacts
uses: actions/cache/save@v3.5.0
with:
path: |
node_modules
apps/frontend/node_modules
apps/backend/node_modules
packages/shared/node_modules
packages/sdk/node_modules
apps/frontend/dist
apps/backend/dist
packages/shared/dist
packages/sdk/dist
services/virus-scanner/build
services/virus-scanner-guardduty/build
key: ${{ runner.os }}-build-playwright-${{ github.sha }}
test:
needs: setup
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
project:
[
'chromium-login',
'chromium-encrypt-submission',
'firefox-login',
'firefox-encrypt-submission',
]
env:
AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE: 1
DD_TAGS: layer:e2e
SHARD_COUNT: 4
steps:
- uses: actions/checkout@v4.3.1
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore build artifacts
uses: actions/cache/restore@v3.5.0
with:
path: |
node_modules
apps/frontend/node_modules
apps/backend/node_modules
packages/shared/node_modules
packages/sdk/node_modules
apps/frontend/dist
apps/backend/dist
packages/shared/dist
packages/sdk/dist
services/virus-scanner/build
services/virus-scanner-guardduty/build
key: ${{ runner.os }}-build-playwright-${{ github.sha }}
fail-on-cache-miss: true
- name: Configure Datadog Test Visibility
uses: datadog/test-visibility-github-action@7f2b515b64333229315f4701adc590ee6586b270 # v1.0.5
with:
languages: js
service-name: ${{ secrets.DD_SERVICE }}
api-key: ${{ secrets.DD_API_KEY }}
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
env:
NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }}
run: pnpm exec playwright test --project=${{ matrix.project }}
- uses: actions/upload-artifact@v4.6.2
if: always()
with:
name: playwright-report-${{ matrix.project }}
path: playwright-report/
retention-days: 30