-
Notifications
You must be signed in to change notification settings - Fork 7
153 lines (132 loc) · 5.02 KB
/
dashnote-e2e.yml
File metadata and controls
153 lines (132 loc) · 5.02 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
name: Dashnote E2E
on:
push:
branches: [main]
paths:
- 'example-apps/dashnote/**'
- '.github/workflows/dashnote-e2e.yml'
pull_request:
branches: [main]
paths:
- 'example-apps/dashnote/**'
- '.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:
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: '20'
- 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: '20'
- 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