|
| 1 | +name: AAT Reports |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - next-major |
| 7 | + workflow_call: |
| 8 | + outputs: |
| 9 | + aat-all-flags: |
| 10 | + value: ${{ jobs.aat-all-flags.result }} |
| 11 | + aat-no-flag: |
| 12 | + value: ${{ jobs.aat.result }} |
| 13 | + merge_group: |
| 14 | + branches: |
| 15 | + - main |
| 16 | + - next-major |
| 17 | + types: |
| 18 | + - checks_requested |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: aat-${{ github.workflow }}-${{ github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +jobs: |
| 25 | + aat-runner: |
| 26 | + runs-on: ubuntu-latest-16-cores |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + shard: [1, 2, 3, 4] |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - name: Use Node.js 20.x |
| 34 | + uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: 22 |
| 37 | + cache: 'npm' |
| 38 | + - name: Install dependencies |
| 39 | + run: npm ci |
| 40 | + - name: Build storybook |
| 41 | + run: npx storybook build |
| 42 | + working-directory: packages/react |
| 43 | + - name: Run storybook |
| 44 | + id: storybook |
| 45 | + working-directory: packages/react |
| 46 | + run: | |
| 47 | + npx serve -l 6006 storybook-static & |
| 48 | + pid=$! |
| 49 | + echo "pid=$pid" >> $GITHUB_OUTPUT |
| 50 | + sleep 5 |
| 51 | + - name: Run AAT |
| 52 | + uses: docker://mcr.microsoft.com/playwright:v1.47.2-jammy |
| 53 | + env: |
| 54 | + STORYBOOK_URL: 'http://172.17.0.1:6006' |
| 55 | + with: |
| 56 | + args: npx playwright test --grep @aat --shard="${{ matrix.shard }}/${{ strategy.job-total }}" |
| 57 | + - name: Stop storybook |
| 58 | + run: kill ${{ steps.storybook.outputs.pid }} |
| 59 | + - name: Upload report |
| 60 | + if: ${{ always() }} |
| 61 | + uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: axe-no-flag-${{ matrix.shard }} |
| 64 | + path: blob-report |
| 65 | + retention-days: 1 |
| 66 | + |
| 67 | + aat: |
| 68 | + if: ${{ always() }} |
| 69 | + runs-on: ubuntu-latest |
| 70 | + needs: aat-runner |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + - name: Use Node.js 20.x |
| 74 | + uses: actions/setup-node@v4 |
| 75 | + with: |
| 76 | + node-version: 22 |
| 77 | + cache: 'npm' |
| 78 | + - name: install dependencies |
| 79 | + run: npm ci |
| 80 | + - name: download all reports |
| 81 | + uses: actions/download-artifact@v4 |
| 82 | + with: |
| 83 | + path: all-blob-reports |
| 84 | + pattern: axe-no-flag-* |
| 85 | + merge-multiple: true |
| 86 | + - name: merge all reports |
| 87 | + run: npx playwright merge-reports --reporter html ./all-blob-reports |
| 88 | + - name: Upload report |
| 89 | + uses: actions/upload-artifact@v4 |
| 90 | + with: |
| 91 | + name: axe |
| 92 | + path: playwright-report |
| 93 | + - name: Check aat-runner job status |
| 94 | + if: ${{ needs.aat-runner.result == 'failure' }} |
| 95 | + continue-on-error: true |
| 96 | + run: exit 1 |
| 97 | + |
| 98 | + aat-runner-all-flags: |
| 99 | + runs-on: ubuntu-latest-16-cores |
| 100 | + strategy: |
| 101 | + fail-fast: false |
| 102 | + matrix: |
| 103 | + shard: [1, 2, 3, 4] |
| 104 | + env: |
| 105 | + VITE_PRIMER_REACT_CSS_MODULES_TEAM: 1 |
| 106 | + VITE_PRIMER_REACT_CSS_MODULES_STAFF: 1 |
| 107 | + VITE_PRIMER_REACT_CSS_MODULES_GA: 1 |
| 108 | + steps: |
| 109 | + - uses: actions/checkout@v4 |
| 110 | + - name: Use Node.js 20.x |
| 111 | + uses: actions/setup-node@v4 |
| 112 | + with: |
| 113 | + node-version: 22 |
| 114 | + cache: 'npm' |
| 115 | + - name: Install dependencies |
| 116 | + run: npm ci |
| 117 | + - name: Build storybook |
| 118 | + run: npx storybook build |
| 119 | + working-directory: packages/react |
| 120 | + - name: Run storybook |
| 121 | + id: storybook |
| 122 | + working-directory: packages/react |
| 123 | + run: | |
| 124 | + npx serve -l 6006 storybook-static & |
| 125 | + pid=$! |
| 126 | + echo "pid=$pid" >> $GITHUB_OUTPUT |
| 127 | + sleep 5 |
| 128 | + - name: Run AAT |
| 129 | + uses: docker://mcr.microsoft.com/playwright:v1.47.2-jammy |
| 130 | + env: |
| 131 | + STORYBOOK_URL: 'http://172.17.0.1:6006' |
| 132 | + with: |
| 133 | + args: npx playwright test --grep @aat --shard="${{ matrix.shard }}/${{ strategy.job-total }}" |
| 134 | + - name: Stop storybook |
| 135 | + run: kill ${{ steps.storybook.outputs.pid }} |
| 136 | + - name: Upload report |
| 137 | + if: ${{ always() }} |
| 138 | + uses: actions/upload-artifact@v4 |
| 139 | + with: |
| 140 | + name: axe-all-flags-${{ matrix.shard }} |
| 141 | + path: blob-report |
| 142 | + retention-days: 1 |
| 143 | + |
| 144 | + aat-all-flags: |
| 145 | + if: ${{ always() }} |
| 146 | + runs-on: ubuntu-latest |
| 147 | + needs: aat-runner-all-flags |
| 148 | + steps: |
| 149 | + - uses: actions/checkout@v4 |
| 150 | + - name: Use Node.js 20.x |
| 151 | + uses: actions/setup-node@v4 |
| 152 | + with: |
| 153 | + node-version: 22 |
| 154 | + cache: 'npm' |
| 155 | + - name: install dependencies |
| 156 | + run: npm ci |
| 157 | + - name: download all reports |
| 158 | + uses: actions/download-artifact@v4 |
| 159 | + with: |
| 160 | + path: all-blob-reports |
| 161 | + pattern: axe-all-flags-* |
| 162 | + merge-multiple: true |
| 163 | + - name: merge all reports |
| 164 | + run: npx playwright merge-reports --reporter html ./all-blob-reports |
| 165 | + - name: Upload report |
| 166 | + uses: actions/upload-artifact@v4 |
| 167 | + with: |
| 168 | + name: axe-all-flags |
| 169 | + path: playwright-report |
| 170 | + - name: Check aat-runner-all-flags job status |
| 171 | + if: ${{ needs.aat-runner-all-flags.result == 'failure' }} |
| 172 | + continue-on-error: true |
| 173 | + run: exit 1 |
0 commit comments