Repository navigation
249 lines (202 loc) · 7.09 KB
/
Copy pathci.yml
File metadata and controls
249 lines (202 loc) · 7.09 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: CI
on:
push:
branches: [develop, main]
pull_request:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
runs-on: ${{ matrix.os }}
# Run each command in parallel with the same setup steps.
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
config:
# Specify names so that the GitHub branch protection settings for
# required checks don't need to change if we ever change the commands used.
- name: npm audit
command: yarn npm audit --all --recursive --severity high
- name: lint
command: |
# lint steps
set -x
yarn license-check
yarn dedupe --check
yarn run tsc --noEmit # typecheck files that are not included by webpack or package builds
yarn run format:ci
yarn run lint:ci
yarn run lint:unused-exports
yarn run lint:dependencies
- name: packages
command: yarn run build:packages
- name: web
command: yarn run web:build:prod
- name: desktop
command: yarn run desktop:build:prod
- name: build benchmark
command: yarn run benchmark:build:prod
- name: test
command: yarn run test --maxWorkers=100%
include:
- os: windows-latest
config:
name: packages
command: echo complete
name: ${{ matrix.config.name }} (${{ matrix.os }})
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
- run: corepack enable yarn
- name: Restore cache
uses: actions/cache@v6
with:
path: |
.yarn/cache
**/node_modules
key: v5-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: v5-${{ runner.os }}-yarn-
- run: yarn install --immutable
- run: ${{ matrix.config.command }}
e2e-desktop:
runs-on: ubuntu-latest
# Run smoke tests in parallel across 2 shards
# Full regression runs separately in e2e-regression.yml (nightly + develop/main)
strategy:
fail-fast: false
matrix:
shard: [1, 2]
name: e2e-desktop (ubuntu-latest) [${{ matrix.shard }}/2]
# Set a fixed timezone to ensure consistent test results.
# Lichtblick uses the system's local timezone, which can cause test assertions
# to fail due to time discrepancies across different environments.
env:
TZ: Europe/Lisbon
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
- run: corepack enable yarn
- name: Restore cache
uses: actions/cache@v6
with:
path: |
.yarn/cache
**/node_modules
key: v5-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: v5-${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Apply AppArmor Fix (Ubuntu)
# Required for Playwright on Ubuntu to work properly
# See: https://github.com/microsoft/playwright/issues/34251
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
# It must be dev build, otherwise playwright wont't have all data-testid avaiable for icons
# https://mui.com/material-ui/migration/upgrade-to-v7/#svgicons-data-testid-removed
- name: Build desktop app
run: yarn desktop:build:dev
- name: Run E2E Desktop smoke tests - Shard ${{ matrix.shard }}/2
uses: coactions/setup-xvfb@v1
with:
working-directory: ./
run: yarn test:e2e:desktop:smoke:ci --shard=${{ matrix.shard }}/2
- name: Upload Desktop E2E Test Reports (Shard ${{ matrix.shard }})
if: always()
uses: actions/upload-artifact@v7
with:
name: blob-report-desktop-${{ matrix.shard }}
path: blob-report
retention-days: 1
e2e-web:
runs-on: ubuntu-latest
name: e2e-web (ubuntu-latest)
env:
TZ: Europe/Lisbon
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
- run: corepack enable yarn
- name: Restore cache
uses: actions/cache@v6
with:
path: |
.yarn/cache
**/node_modules
key: v5-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: v5-${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run E2E Web smoke tests
run: yarn test:e2e:web:smoke:ci
- name: Upload Web E2E Test Reports
if: always()
uses: actions/upload-artifact@v7
with:
name: e2e-web-reports
path: e2e/reports/web/
retention-days: 7
if-no-files-found: warn
# Merge reports from all shards and generate summary
e2e-report:
if: always()
needs: [e2e-desktop, e2e-web]
runs-on: ubuntu-latest
name: e2e-report (merge all reports)
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
- run: corepack enable yarn
- name: Restore cache
uses: actions/cache@v6
with:
path: |
.yarn/cache
**/node_modules
key: v5-${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: v5-${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Download all desktop blob reports
uses: actions/download-artifact@v8
with:
pattern: blob-report-desktop-*
path: all-blob-reports-desktop
merge-multiple: true
- name: Download web reports
uses: actions/download-artifact@v8
with:
name: e2e-web-reports
path: e2e/reports/web
continue-on-error: true
- name: Merge Desktop Playwright reports
run: |
mkdir -p e2e/reports/desktop
echo "Downloaded desktop blob reports:"
ls -la all-blob-reports-desktop/ || echo "No desktop blob reports found"
# Merge blob reports into JSON format
npx playwright merge-reports --reporter json ./all-blob-reports-desktop > e2e/reports/desktop/results.json
# Also generate HTML report
npx playwright merge-reports --reporter html ./all-blob-reports-desktop
echo "Merged desktop report size:"
ls -lh e2e/reports/desktop/results.json
- name: Generate E2E Test Summary
run: |
echo "Generating E2E test summary from merged reports..."
yarn ts-node e2e/ci-helpers/generate-test-summary.ts >> $GITHUB_STEP_SUMMARY
- name: Upload Merged E2E Test Reports
if: always()
uses: actions/upload-artifact@v7
with:
name: e2e-test-reports-merged
path: |
e2e/reports/
playwright-report/
retention-days: 7