-
Notifications
You must be signed in to change notification settings - Fork 7
182 lines (158 loc) · 6 KB
/
Copy pathdashnote-e2e.yml
File metadata and controls
182 lines (158 loc) · 6 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Dashnote E2E
on:
push:
branches: [main]
paths:
- 'example-apps/dashnote/**'
- 'example-apps/token-ops/src/dash/loginWithPrivateKey.ts'
- 'example-apps/token-ops/src/lib/detectSecretShape.ts'
- 'example-apps/token-ops/src/session/keyManagerFromKey.ts'
- 'scripts/check-shared-auth-parity.sh'
- '.github/workflows/dashnote-e2e.yml'
pull_request:
branches: [main]
paths:
- 'example-apps/dashnote/**'
- 'example-apps/token-ops/src/dash/loginWithPrivateKey.ts'
- 'example-apps/token-ops/src/lib/detectSecretShape.ts'
- 'example-apps/token-ops/src/session/keyManagerFromKey.ts'
- 'scripts/check-shared-auth-parity.sh'
- '.github/workflows/dashnote-e2e.yml'
workflow_dispatch:
inputs:
test_suite:
description: 'Which specs to run'
type: choice
options:
- read-only
- read-write
- all
default: read-only
permissions:
contents: read
concurrency:
group: dashnote-e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
auth-parity:
name: shared auth parity
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check shared authentication parity
run: bash scripts/check-shared-auth-parity.sh
e2e-read-only:
name: e2e (read-only — smoke + settings)
runs-on: ubuntu-latest
timeout-minutes: 20
if: >
github.event_name != 'workflow_dispatch' ||
inputs.test_suite == 'read-only' ||
inputs.test_suite == 'all'
defaults:
run:
working-directory: example-apps/dashnote
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: .nvmrc
- name: Show Node/npm versions
run: |
node -v
npm -v
- name: Install dashnote dependencies
run: npm ci
- name: Resolve Playwright version
id: playwright-version
run: echo "version=$(node -p "require('./package.json').devDependencies['@playwright/test']")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- name: Install browser system deps (cache hit)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Run read-only specs
env:
PLATFORM_MNEMONIC: ${{ secrets.PLATFORM_MNEMONIC }}
run: npx playwright test smoke.spec.ts settings.spec.ts
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-read-only
path: example-apps/dashnote/playwright-report/
retention-days: 14
- name: Upload Playwright traces on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-test-results-read-only
path: example-apps/dashnote/test-results/
retention-days: 14
e2e-read-write:
name: e2e (read-write — auth + notes)
runs-on: ubuntu-latest
timeout-minutes: 60
if: >
github.event_name == 'workflow_dispatch' &&
(inputs.test_suite == 'read-write' || inputs.test_suite == 'all')
concurrency:
group: dashnote-e2e-read-write
cancel-in-progress: false
defaults:
run:
working-directory: example-apps/dashnote
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: .nvmrc
- name: Show Node/npm versions
run: |
node -v
npm -v
- name: Install dashnote dependencies
run: npm ci
- name: Resolve Playwright version
id: playwright-version
run: echo "version=$(node -p "require('./package.json').devDependencies['@playwright/test']")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- name: Install browser system deps (cache hit)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Run read-write specs
env:
PLATFORM_MNEMONIC: ${{ secrets.PLATFORM_MNEMONIC }}
run: npx playwright test auth.spec.ts notes.spec.ts
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-read-write
path: example-apps/dashnote/playwright-report/
retention-days: 14
- name: Upload Playwright traces on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-test-results-read-write
path: example-apps/dashnote/test-results/
retention-days: 14