-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.46 KB
/
sharded-vitest.yml
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
name: Vitest Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2]
total-shards: [2]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm i
- name: Run Vitest Tests (Shard ${{ matrix.shard }}/${{ matrix.total-shards }})
continue-on-error: true
run: npx vitest --run --shard=${{ matrix.shard }}/${{ matrix.total-shards }} vitest-sharded-example/tests/** --reporter=junit --outputFile=./vitest-sharded-example/results-${{ matrix.shard }}.xml
- name: Combine Vitest Sharded results
run: node ./scripts/combineResults.js --reports-dir vitest-sharded-example --output-file vitest-sharded-example/currents.results.xml
- name: Generate Instance files
run: node scripts/junitXmlToInstanceJson.js --input vitest-sharded-example/currents.results.xml --output vitest-sharded-example/instances
- name: Report Vitest Sharded results
env:
CURRENTS_KEY: ${{ secrets.CURRENTS_KEY }}
CURRENTS_PROJECT_ID: ${{ secrets.CURRENTS_PROJECT_ID }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_number }}
run: node scripts/uploadResults.js --report-dir vitest-sharded-example