-
Notifications
You must be signed in to change notification settings - Fork 61
633 lines (622 loc) · 22.5 KB
/
cd.yml
File metadata and controls
633 lines (622 loc) · 22.5 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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
name: cd
on:
pull_request:
workflow_dispatch:
push:
branches: [master, release/v16, release/v17]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
defineChangedComponents:
runs-on: ubuntu-latest
outputs:
changedComponents: ${{ steps.pkg-diff.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 22
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Define changed components
id: pkg-diff
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
echo "changed=$(BASE=origin/${{ github.event.pull_request.base.ref }} pnpm pkg-diff | tail -n 1)" >> $GITHUB_OUTPUT
- name: Set labels
if: steps.pkg-diff.outputs.changed != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGED: ${{ steps.pkg-diff.outputs.changed }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
EXISTING_LABELS=$(gh label list --repo "$REPO" --limit 100 --json name --jq '.[].name')
PR_LABELS=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json labels --jq '.labels[].name')
PR_LABELS_LIST=$(echo "$PR_LABELS" | tr '\n' ' ')
CHANGED_COMPONENTS=$(echo "$CHANGED" | tr ' ' '\n')
LABELS_TO_REMOVE=""
LABELS_TO_ADD=""
echo CHANGED: "$CHANGED"
for LABEL in $CHANGED; do
if ! echo "$EXISTING_LABELS" | grep -qx "$LABEL"; then
echo "Creating label '$LABEL'"
gh label create "$LABEL" --repo "$REPO"
fi
if ! echo "$PR_LABELS" | grep -qx "$LABEL"; then
LABELS_TO_ADD="$LABELS_TO_ADD,$LABEL"
fi
done
for LABEL in $PR_LABELS_LIST; do
if ! echo "$CHANGED_COMPONENTS" | grep -qx "$LABEL"; then
LABELS_TO_REMOVE="$LABELS_TO_REMOVE,$LABEL"
fi
done
LABELS_TO_ADD="${LABELS_TO_ADD#","}"
LABELS_TO_REMOVE="${LABELS_TO_REMOVE#","}"
echo ADD: "$LABELS_TO_ADD"
echo REMOVE: "$LABELS_TO_REMOVE"
if [ -n $LABELS_TO_REMOVE ]; then
gh pr edit "$PR_NUMBER" --remove-label "$LABELS_TO_REMOVE" --repo "$REPO"
fi
if [ -n $LABELS_TO_ADD ]; then
gh pr edit "$PR_NUMBER" --add-label "$LABELS_TO_ADD" --repo "$REPO"
fi
build:
runs-on: ubuntu-latest
needs: defineChangedComponents
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 22
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Cache build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
pnpm build
static-lint:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 22
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
get-changed-files:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed-files.outputs.changed_files }}
count: ${{ steps.changed-files.outputs.count }}
skip_docs_lint: ${{ steps.changed-files.outputs.skip_docs_lint }}
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Get changed files list
id: changed-files
run: |
FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.pull_request.base.sha || 'HEAD^1' }} -- '*.md' | paste -sd "," -)
echo "changed_files=$FILES" >> $GITHUB_OUTPUT
ALL_FILES_COUNT=$(git diff --name-only ${{ github.event.pull_request.base.sha || 'HEAD^1' }} | wc -l)
echo "count=$ALL_FILES_COUNT" >> $GITHUB_OUTPUT
if [[ -z "$FILES" ]]; then
echo "::notice::The docs-lint job will be skipped because there’s no changed .md files."
echo "skip_docs_lint=true" >> $GITHUB_OUTPUT
fi
if [[ $ALL_FILES_COUNT -gt 300 && -n "$FILES" ]]; then
echo "::warning::The docs-lint job will be skipped because there’s >300 files in the PR. Please run the linter locally."
fi
docs-lint:
runs-on: ubuntu-latest
needs: get-changed-files
if: ${{ needs.get-changed-files.outputs.skip_docs_lint != 'true' && needs.get-changed-files.outputs.count <= 300 && needs.get-changed-files.outputs.count > 0 }}
steps:
- uses: actions/checkout@v4.1.1
- uses: errata-ai/vale-action@reviewdog
name: Run Vale
with:
reporter: github-pr-review
separator: ","
vale_flags: "--minAlertLevel=warning"
files: ${{ needs.get-changed-files.outputs.changed_files }}
unit-tests:
runs-on: ubuntu-latest
needs: [build, defineChangedComponents]
if: ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 22
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
- name: Test setup
id: test-setup
run: pnpm test:setup
- name: Test
id: test
env:
CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }}
run: pnpm test:docker run $CHANGED_COMPONENTS -- --allowOnly=false
continue-on-error: true
- name: Save test results as artifacts
if: steps.test.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: unit-testing-failure-output
path: semcore/*/__tests__/__image_snapshots__/__diff_output__/
retention-days: 3
- name: Fail if test step actually failed
if: steps.test.outcome != 'success'
run: exit 1
# a11y-tests:
# runs-on: macos-14
# needs: build
# steps:
# - uses: actions/checkout@v4.1.1
# - name: Install Node.js
# uses: actions/setup-node@v4.0.1
# with:
# node-version: 22
# - uses: pnpm/action-setup@v4.0.0
# name: Install pnpm
# id: pnpm-install
# with:
# version: 10.11.1
# run_install: false
# - name: Get pnpm store directory
# id: pnpm-cache
# run: |
# echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
# - uses: actions/cache@v4
# name: Setup pnpm cache
# with:
# path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
# key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# - name: Restore cached build
# uses: actions/cache@v4
# id: cache-build
# with:
# path: |
# semcore/*/lib
# tools/*/lib
# semcore/icon/**/*.js
# semcore/icon/**/*.mjs
# semcore/icon/**/*.d.ts
# semcore/illustration/**/*.js
# semcore/illustration/**/*.mjs
# semcore/illustration/**/*.d.ts
# key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
# - name: Install dependencies
# run: |
# pnpm install --frozen-lockfile
# - name: Install Browser
# run: npx playwright install webkit
# - name: Enable VoiceOver Automation
# uses: guidepup/setup-action@0.15.3
# - name: Voice Over testing
# id: a11y-testing
# uses: nick-fields/retry@v2.8.3
# with:
# timeout_minutes: 40
# max_attempts: 3
# command: pnpm run vo-test:ci
# continue-on-error: true
# - name: Save test results as artifacts
# if: steps.a11y-testing.outcome != 'success'
# uses: actions/upload-artifact@v4
# with:
# name: a11y-testing-failure-output
# path: test-results
# retention-days: 3
# - name: Fail if test step actually failed
# if: steps.a11y-testing.outcome != 'success'
# run: exit 1
browser-tests-visual:
runs-on: ubuntu-latest
needs: [ build, defineChangedComponents ]
if: ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
container:
image: mcr.microsoft.com/playwright:v1.58.2-jammy
options: --ipc=host # Needed for Chromium sandboxing
steps:
- name: Install Git
run: apt-get update && apt-get install -y git
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false
- name: Mark workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: pnpm/action-setup@v4.0.0
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile --ignore-scripts
- name: Install Browser
run: npx playwright install --with-deps
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Build basic packages
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
pnpm --filter @semcore/core build
pnpm --filter @semcore/base-components build
pnpm build:icons
pnpm build:illustration
- name: Browser testing (Visual tests - ${{ matrix.browser }})
id: browser-testing-visual
env:
CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }}
run: HOME=/root pnpm playwright test --config playwright.browser.config.ts --grep "@visual" --project=${{ matrix.browser }} $CHANGED_COMPONENTS
continue-on-error: true
- name: Save test results as artifacts
if: steps.browser-testing-visual.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: browser-testing-visual-${{ matrix.browser }}-failure-output
path: test-results
retention-days: 3
- name: Fail if test step actually failed
if: steps.browser-testing-visual.outcome != 'success'
run: exit 1
browser-tests-functional:
runs-on: ubuntu-latest
needs: [ build, defineChangedComponents ]
if: ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
container:
image: mcr.microsoft.com/playwright:v1.58.2-jammy
options: --ipc=host # Needed for Chromium sandboxing
steps:
- name: Install Git
run: apt-get update && apt-get install -y git
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false
- name: Mark workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: pnpm/action-setup@v4.0.0
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: |
pnpm install --frozen-lockfile --ignore-scripts
- name: Install Browser
run: npx playwright install --with-deps
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
- name: Build basic packages
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
pnpm --filter @semcore/core build
pnpm --filter @semcore/base-components build
pnpm build:icons
pnpm build:illustration
- name: Browser testing (Functional tests - ${{ matrix.browser }})
id: browser-testing-functional
env:
CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }}
run: HOME=/root pnpm playwright test --config playwright.browser.config.ts --grep "@functional" --project=${{ matrix.browser }} $CHANGED_COMPONENTS
continue-on-error: true
- name: Save test results as artifacts
if: steps.browser-testing-functional.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: browser-testing-functional-${{ matrix.browser }}-failure-output
path: test-results
retention-days: 3
- name: Fail if test step actually failed
if: steps.browser-testing-functional.outcome != 'success'
run: exit 1
axe-tests:
runs-on: ubuntu-latest
needs: [ build, defineChangedComponents ]
if: ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
container:
image: mcr.microsoft.com/playwright:v1.58.2-jammy
options: --ipc=host # Needed for Chromium sandboxing
steps:
- name: Install Git
run: apt-get update && apt-get install -y git
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
fetch-depth: 0
- name: Mark workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: pnpm/action-setup@v4.0.0
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile --ignore-scripts
- name: Install Browser
run: npx playwright install --with-deps
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Build basic packages
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
pnpm --filter @semcore/core build
pnpm --filter @semcore/base-components build
pnpm build:icons
pnpm build:illustration
- name: Axe testing
id: axe-testing
env:
CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }}
run: HOME=/root pnpm playwright test --config playwright.axe.config.ts $CHANGED_COMPONENTS
continue-on-error: true
- name: Save test results as artifacts
if: steps.axe-testing.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: axe-testing-failure-output
path: test-results
retention-days: 3
- name: Fail if test step actually failed
if: steps.axe-testing.outcome != 'success'
run: exit 1
nvda-tests:
runs-on: windows-latest
needs: [ build, defineChangedComponents ]
if: ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 22
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: pwsh
run: |
$pnpmStorePath = pnpm store path
echo "pnpm_cache_dir=$pnpmStorePath" >> $env:GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
enableCrossOsArchive: true
- name: Restore cached build
uses: actions/cache@v4
id: cache-build
with:
path: |
semcore/*/lib
tools/*/lib
semcore/illustration/**/*.js
semcore/illustration/**/*.mjs
semcore/illustration/**/*.d.ts
key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
enableCrossOsArchive: true
- name: Install dependencies
run: |
pnpm install --frozen-lockfile --ignore-scripts
- name: Install Playwright Browsers
run: npx playwright install
- name: NVDA setup
run: pnpm nvda-test:setup
- name: NVDA testing
id: nvda-testing
env:
CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }}
shell: pwsh
run: |
$components = $env:CHANGED_COMPONENTS -split '\s+' | Where-Object { $_ }
if (-not $components -or $components.Count -eq 0) {
Write-Host "No changed components; skipping."
exit 0
}
pnpm --filter @semcore/core build
pnpm --filter @semcore/icon build
pnpm exec playwright test --config playwright.nvda.config.ts -- $components
continue-on-error: true
- name: Save test results as artifacts
if: steps.nvda-testing.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: nvda-testing-failure-output
path: test-results
retention-days: 3
- name: Fail if test step actually failed
if: steps.nvda-testing.outcome != 'success'
run: exit 1