@@ -215,77 +215,6 @@ jobs:
215215 if : needs.unit-tests.result != 'success'
216216 run : exit 1
217217
218- test-coverage-shard :
219- if : ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
220- name : " Test Coverage (shard ${{ matrix.shard }})"
221- runs-on : ubuntu-latest
222- timeout-minutes : 30
223- strategy :
224- matrix :
225- shard : ['1/2', '2/2']
226- steps :
227- - uses : actions/checkout@v3
228- with :
229- repository : ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
230- ref : ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
231- fetch-depth : 1
232- - name : Setup deps
233- uses : ./.github/actions/setup-cli-deps
234- with :
235- node-version : ${{ env.DEFAULT_NODE_VERSION }}
236- - name : Unit tests with coverage (shard)
237- run : pnpm vitest run --coverage --coverage.all=false --reporter=blob --outputFile=vitest-blob-reports/blob-${{ matrix.shard == '1/2' && '1' || '2' }}.json --shard ${{ matrix.shard }}
238- env :
239- VITEST_MIN_THREADS : " 1"
240- VITEST_MAX_THREADS : " 4"
241- - uses : actions/upload-artifact@v4
242- with :
243- name : coverage-blob-${{ matrix.shard == '1/2' && '1' || '2' }}
244- path : vitest-blob-reports/
245- retention-days : 1
246-
247- test-coverage-merge :
248- if : ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
249- needs : test-coverage-shard
250- name : ' Test Coverage'
251- runs-on : ubuntu-latest
252- timeout-minutes : 15
253- steps :
254- - uses : actions/checkout@v3
255- with :
256- repository : ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
257- ref : ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
258- fetch-depth : 1
259- - name : Setup deps
260- uses : ./.github/actions/setup-cli-deps
261- with :
262- node-version : ${{ env.DEFAULT_NODE_VERSION }}
263- - uses : actions/download-artifact@v4
264- with :
265- pattern : coverage-blob-*
266- path : vitest-blob-reports
267- merge-multiple : true
268- - name : Merge coverage reports
269- run : pnpm vitest --mergeReports vitest-blob-reports --reporter=json --outputFile=./coverage/report.json --coverage --coverage.all=false
270- - name : Convert coverage to Jest
271- run : ./bin/save-coverage-file.js
272- - name : Take copy of report as new baseline for branch
273- run : cp ./report.json ./baseline-report.json
274- - name : Clean ref name
275- env :
276- SAFE_REF_NAME : " ${{ github.head_ref }}"
277- run : |
278- SAFE_REF_NAME="${SAFE_REF_NAME//[\/.]/}"
279- echo "SAFE_REF_NAME=${SAFE_REF_NAME}" >> $GITHUB_ENV
280- - uses : actions/upload-artifact@v4
281- with :
282- name : ${{ env.SAFE_REF_NAME }}--coverage-report
283- path : ./baseline-report.json
284- - name : Download and publish test coverage
285- uses : ./.github/actions/download-and-publish-test-coverage
286- with :
287- base-branch-name : ' ${{ github.base_ref }}'
288-
289218 e2e-tests :
290219 name : ' E2E tests'
291220 if : github.event.pull_request.head.repo.full_name == github.repository
0 commit comments