3232 name : Setup pnpm cache
3333 with :
3434 path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
35- key : ${{ runner.os }}- pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3636 - name : Install dependencies
3737 run : |
3838 pnpm install --frozen-lockfile
@@ -110,7 +110,8 @@ jobs:
110110 name : Setup pnpm cache
111111 with :
112112 path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
113- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
113+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
114+ enableCrossOsArchive : true
114115 - name : Cache build
115116 uses : actions/cache@v4
116117 id : cache-build
@@ -125,6 +126,7 @@ jobs:
125126 semcore/illustration/**/*.mjs
126127 semcore/illustration/**/*.d.ts
127128 key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
129+ enableCrossOsArchive : true
128130 - name : Install dependencies
129131 run : |
130132 pnpm install --frozen-lockfile
@@ -156,7 +158,8 @@ jobs:
156158 name : Setup pnpm cache
157159 with :
158160 path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
159- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
161+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
162+ enableCrossOsArchive : true
160163 - name : Restore cached build
161164 uses : actions/cache@v4
162165 id : cache-build
@@ -171,6 +174,7 @@ jobs:
171174 semcore/illustration/**/*.mjs
172175 semcore/illustration/**/*.d.ts
173176 key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
177+ enableCrossOsArchive : true
174178 - name : Install dependencies
175179 run : |
176180 pnpm install --frozen-lockfile
@@ -210,7 +214,8 @@ jobs:
210214 name : Setup pnpm cache
211215 with :
212216 path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
213- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
217+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
218+ enableCrossOsArchive : true
214219 - name : Restore cached build
215220 uses : actions/cache@v4
216221 id : cache-build
@@ -225,6 +230,7 @@ jobs:
225230 semcore/illustration/**/*.mjs
226231 semcore/illustration/**/*.d.ts
227232 key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
233+ enableCrossOsArchive : true
228234 - name : Install dependencies
229235 run : |
230236 pnpm install --frozen-lockfile
@@ -270,7 +276,7 @@ jobs:
270276# name: Setup pnpm cache
271277# with:
272278# path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
273- # key: ${{ runner.os }}- pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
279+ # key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
274280# - name: Restore cached build
275281# uses: actions/cache@v4
276282# id: cache-build
@@ -310,10 +316,92 @@ jobs:
310316# - name: Fail if test step actually failed
311317# if: steps.a11y-testing.outcome != 'success'
312318# run: exit 1
313- browser-tests :
319+ browser-tests-visual :
314320 runs-on : ubuntu-latest
315321 needs : [ build, defineChangedComponents ]
316322 if : ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
323+ strategy :
324+ fail-fast : false
325+ matrix :
326+ browser : [chromium, firefox, webkit]
327+ container :
328+ image : mcr.microsoft.com/playwright:v1.48.2-jammy
329+ options : --ipc=host # Needed for Chromium sandboxing
330+ steps :
331+ - name : Install Git
332+ run : apt-get update && apt-get install -y git
333+ 334+ with :
335+ token : ${{ secrets.BOT_ACCOUNT_GITHUB_TOKEN }}
336+ fetch-depth : 0
337+ persist-credentials : false
338+ - name : Mark workspace as safe
339+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
340+ 341+ with :
342+ version : 10.11.1
343+ run_install : false
344+ - name : Get pnpm store directory
345+ id : pnpm-cache
346+ run : |
347+ echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
348+ - uses : actions/cache@v4
349+ name : Setup pnpm cache
350+ with :
351+ path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
352+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
353+ enableCrossOsArchive : true
354+ - name : Install dependencies
355+ run : |
356+ pnpm install --frozen-lockfile --ignore-scripts
357+ - name : Install Browser
358+ run : npx playwright install --with-deps
359+ - name : Restore cached build
360+ uses : actions/cache@v4
361+ id : cache-build
362+ with :
363+ path : |
364+ semcore/*/lib
365+ tools/*/lib
366+ semcore/icon/**/*.js
367+ semcore/icon/**/*.mjs
368+ semcore/icon/**/*.d.ts
369+ semcore/illustration/**/*.js
370+ semcore/illustration/**/*.mjs
371+ semcore/illustration/**/*.d.ts
372+ key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
373+ enableCrossOsArchive : true
374+ - name : Build basic packages
375+ if : steps.cache-build.outputs.cache-hit != 'true'
376+ run : |
377+ pnpm --filter @semcore/core build
378+ pnpm --filter @semcore/base-components build
379+ pnpm build:icons
380+ pnpm build:illustration
381+ - name : Browser testing (Visual tests - ${{ matrix.browser }})
382+ id : browser-testing-visual
383+ env :
384+ CHANGED_COMPONENTS : ${{ needs.defineChangedComponents.outputs.changedComponents }}
385+ run : HOME=/root pnpm playwright test --config playwright.browser.config.ts --grep "@visual" --project=${{ matrix.browser }} $CHANGED_COMPONENTS
386+ continue-on-error : true
387+ - name : Save test results as artifacts
388+ if : steps.browser-testing-visual.outcome != 'success'
389+ uses : actions/upload-artifact@v4
390+ with :
391+ name : browser-testing-visual-${{ matrix.browser }}-failure-output
392+ path : test-results
393+ retention-days : 3
394+ - name : Fail if test step actually failed
395+ if : steps.browser-testing-visual.outcome != 'success'
396+ run : exit 1
397+ browser-tests-functional :
398+ runs-on : ubuntu-latest
399+ needs : [ build, defineChangedComponents ]
400+ if : ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
401+ strategy :
402+ fail-fast : false
403+ matrix :
404+ browser : [chromium, firefox, webkit]
317405 container :
318406 image : mcr.microsoft.com/playwright:v1.48.2-jammy
319407 options : --ipc=host # Needed for Chromium sandboxing
@@ -366,21 +454,21 @@ jobs:
366454 pnpm --filter @semcore/base-components build
367455 pnpm build:icons
368456 pnpm build:illustration
369- - name : Browser testing
370- id : browser-testing
457+ - name : Browser testing (Functional tests - ${{ matrix.browser }})
458+ id : browser-testing-functional
371459 env :
372460 CHANGED_COMPONENTS : ${{ needs.defineChangedComponents.outputs.changedComponents }}
373- run : HOME=/root pnpm playwright test --config playwright.browser.config.ts $CHANGED_COMPONENTS
461+ run : HOME=/root pnpm playwright test --config playwright.browser.config.ts --grep "@functional" --project=${{ matrix.browser }} $CHANGED_COMPONENTS
374462 continue-on-error : true
375463 - name : Save test results as artifacts
376- if : steps.browser-testing.outcome != 'success'
464+ if : steps.browser-testing-functional .outcome != 'success'
377465 uses : actions/upload-artifact@v4
378466 with :
379- name : browser-testing-failure-output
467+ name : browser-testing-functional-${{ matrix.browser }}- failure-output
380468 path : test-results
381469 retention-days : 3
382470 - name : Fail if test step actually failed
383- if : steps.browser-testing.outcome != 'success'
471+ if : steps.browser-testing-functional .outcome != 'success'
384472 run : exit 1
385473 axe-tests :
386474 runs-on : ubuntu-latest
@@ -410,7 +498,8 @@ jobs:
410498 name : Setup pnpm cache
411499 with :
412500 path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
413- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
501+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
502+ enableCrossOsArchive : true
414503 - name : Install dependencies
415504 run : |
416505 pnpm install --frozen-lockfile --ignore-scripts
@@ -430,6 +519,7 @@ jobs:
430519 semcore/illustration/**/*.mjs
431520 semcore/illustration/**/*.d.ts
432521 key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
522+ enableCrossOsArchive : true
433523 - name : Build basic packages
434524 if : steps.cache-build.outputs.cache-hit != 'true'
435525 run : |
@@ -453,3 +543,82 @@ jobs:
453543 - name : Fail if test step actually failed
454544 if : steps.axe-testing.outcome != 'success'
455545 run : exit 1
546+ nvda-tests :
547+ runs-on : windows-latest
548+ needs : [ build, defineChangedComponents ]
549+ if : ${{ needs.defineChangedComponents.outputs.changedComponents != '' }}
550+ steps :
551+ - name : Checkout
552+ 553+ - name : Install Node.js
554+ 555+ with :
556+ node-version : 22
557+ 558+ name : Install pnpm
559+ id : pnpm-install
560+ with :
561+ version : 10.11.1
562+ run_install : false
563+ - name : Get pnpm store directory
564+ id : pnpm-cache
565+ shell : pwsh
566+ run : |
567+ $pnpmStorePath = pnpm store path
568+ echo "pnpm_cache_dir=$pnpmStorePath" >> $env:GITHUB_OUTPUT
569+ - uses : actions/cache@v4
570+ name : Setup pnpm cache
571+ with :
572+ path : ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
573+ key : pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
574+ enableCrossOsArchive : true
575+ - name : Restore cached build
576+ uses : actions/cache@v4
577+ id : cache-build
578+ with :
579+ path : |
580+ semcore/*/lib
581+ tools/*/lib
582+ semcore/icon/**/*.js
583+ semcore/icon/**/*.mjs
584+ semcore/icon/**/*.d.ts
585+ semcore/illustration/**/*.js
586+ semcore/illustration/**/*.mjs
587+ semcore/illustration/**/*.d.ts
588+ key : build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-5
589+ enableCrossOsArchive : true
590+ - name : Install dependencies
591+ run : |
592+ pnpm install --frozen-lockfile --ignore-scripts
593+ - name : Install Playwright Browsers
594+ run : npx playwright install
595+ - name : NVDA setup
596+ run : pnpm nvda-test:setup
597+ - name : NVDA testing
598+ id : nvda-testing
599+ env :
600+ CHANGED_COMPONENTS : ${{ needs.defineChangedComponents.outputs.changedComponents }}
601+ shell : pwsh
602+ run : |
603+ $components = $env:CHANGED_COMPONENTS -split '\s+' | Where-Object { $_ }
604+
605+ if (-not $components -or $components.Count -eq 0) {
606+ Write-Host "No changed components; skipping."
607+ exit 0
608+ }
609+
610+ pnpm --filter @semcore/core build
611+ pnpm --filter @semcore/icon build
612+
613+ pnpm exec playwright test --config playwright.nvda.config.ts -- $components
614+ continue-on-error : true
615+ - name : Save test results as artifacts
616+ if : steps.nvda-testing.outcome != 'success'
617+ uses : actions/upload-artifact@v4
618+ with :
619+ name : nvda-testing-failure-output
620+ path : test-results
621+ retention-days : 3
622+ - name : Fail if test step actually failed
623+ if : steps.nvda-testing.outcome != 'success'
624+ run : exit 1
0 commit comments