99 showcase :
1010 required : true
1111 type : string
12- path :
13- required : false
14- type : string
12+ outputs :
13+ aria-snapshots-changed :
14+ description : " If aria snapshots changed in current PR"
15+ value : ${{ jobs.playwright-showcases.outputs.aria-snapshots-changed }}
16+ aria-snapshots-changed-to-main :
17+ description : " If aria snapshots changed to main branch"
18+ value : ${{ jobs.playwright-showcases.outputs.aria-snapshots-changed-to-main }}
19+ visual-snapshots-changed :
20+ description : " If visual snapshots changed"
21+ value : ${{ jobs.playwright-showcases.outputs.visual-snapshots-changed }}
1522
1623permissions :
1724 actions : write
@@ -27,11 +34,18 @@ jobs:
2734 strategy :
2835 fail-fast : false
2936 matrix :
30- shardIndex : [1, 2, 3, 4, 5, 6]
31- shardTotal : [6]
37+ shardIndex : [1, 2, 3, 4]
38+ shardTotal : [4]
39+ outputs :
40+ aria-snapshots-changed : ${{ steps.aria-snapshots.outputs.aria-snapshots-changed }}
41+ aria-snapshots-changed-to-main : ${{ steps.aria-snapshots.outputs.aria-snapshots-changed-to-main }}
42+ visual-snapshots-changed : ${{ steps.visual-snapshots.outputs.visual-snapshots-changed }}
3243 steps :
3344 - name : ⏬ Checkout repo
3445 uses : actions/checkout@v4
46+ with :
47+ fetch-depth : 0 # fetch all history for all branches
48+ fetch-tags : false
3549
3650 - name : 🔄 Init Cache
3751 uses : ./.github/actions/npm-cache
@@ -60,21 +74,50 @@ jobs:
6074 name : db-ux-${{ inputs.showcase }}
6175 path : build-showcases/${{ inputs.showcase }}
6276
63- - name : 🧴 Copy patternhub testing app
64- if : inputs.path
65- shell : bash
66- run : |
67- mkdir --parents ./build-showcases${{ inputs.path }}
68- cp --recursive --no-target-directory ./build-showcases/${{ inputs.showcase }} ./build-showcases${{ inputs.path }}
69-
77+ # We test everything for patternhub and main branch
7078 - name : 👩🔬 Test showcase with Playwright 🎭
7179 shell : bash
80+ if : github.event.pull_request == null
7281 env :
7382 NEXT_PUBLIC_BASE_PATH : ${{ inputs.path }}
7483 run : |
75- ls ./build-showcases${{ inputs.path }}
7684 npm run test:e2e --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
7785
86+ # We check if aria-snapshots were changed
87+ - name : 👩🔬 Test aria-snapshots with Playwright 🎭
88+ id : aria-snapshots
89+ shell : bash
90+ if : github.event.pull_request != null
91+ run : |
92+ npm run test:aria-snapshots --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --update-snapshots
93+ OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-aria.ts)
94+ echo "aria-snapshots-changed=$OUTPUT" >> $GITHUB_OUTPUT
95+ OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-main-aria.ts)
96+ echo "aria-snapshots-changed-to-main=$OUTPUT" >> $GITHUB_OUTPUT
97+
98+ - name : 👩🔬 Test axe-core with Playwright 🎭
99+ shell : bash
100+ if : github.event.pull_request != null
101+ run : |
102+ npm run test:axe-core --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
103+
104+ - name : 👩🔬 Test visual-snapshots with Playwright 🎭
105+ id : visual-snapshots
106+ shell : bash
107+ if : github.event.pull_request != null
108+ run : |
109+ npm run test:visual-snapshots --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --update-snapshots
110+ OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-visual.ts)
111+ echo "visual-snapshots-changed=$OUTPUT" >> $GITHUB_OUTPUT
112+
113+ - name : 👩🔬 Test a11y-checker with Playwright 🎭
114+ shell : bash
115+ if : |
116+ github.event.pull_request != null &&
117+ steps.aria-snapshots.outputs.aria-snapshots-changed-to-main=='true'
118+ run : |
119+ npm run test:a11y-checker --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
120+
78121 - name : 🔣 Print GitHub Report
79122 if : failure()
80123 shell : bash
@@ -88,11 +131,3 @@ jobs:
88131 name : ${{ inputs.showcase }}-playwright-results-${{ matrix.shardIndex }}
89132 path : ./showcases/${{ inputs.showcase }}/test-results
90133 retention-days : 30
91-
92- - name : 🆙 Upload aChecker results
93- if : failure()
94- uses : actions/upload-artifact@v4
95- with :
96- name : ${{ inputs.showcase }}-showcase-achecker-results-${{ matrix.shardIndex }}
97- path : ./showcases/${{ inputs.showcase }}-showcase/results
98- retention-days : 30
0 commit comments