-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (66 loc) · 2.01 KB
/
Copy pathexample-jest.yaml
File metadata and controls
69 lines (66 loc) · 2.01 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: examples jest workflow
on:
push:
jobs:
default-test:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1/3, 2/3, 3/3]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run test
run: pnpx jest --shard=${{ matrix.shard }}
working-directory: examples/jest
use-tenbin-jest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3]
shardTotal: [3]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run build
run: pnpm run build
- name: Restore tenbin-report.json
id: tenbin-report-cache
uses: actions/cache/restore@v4
with:
path: tenbin-report.json
key: tenbin-report
restore-keys: |
tenbin-report-*
- name: Copy tenbin-report.json to working directory
run: |
if [ -e ./tenbin-report.json ]; then
jq . tenbin-report.json
cp tenbin-report.json examples/jest
fi
- name: Run test
run: pnpx jest --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} -c jest-with-tenbin.config.js
working-directory: examples/jest
- name: Upload tenbin-report.json
if: github.ref_name == 'main'
uses: actions/upload-artifact@v4
with:
name: tenbin-report-${{ matrix.shardIndex }}
path: examples/jest/tenbin-report.json
merge-and-cache-tenbin-report:
if: github.ref_name == 'main'
runs-on: ubuntu-latest
needs: [use-tenbin-jest]
steps:
- uses: actions/download-artifact@v4
with:
path: tenbin-report
pattern: tenbin-report-*
- name: Merge tenbin-report
run: jq -s add tenbin-report/**/tenbin-report.json > tenbin-report.json
- name: Cache tenbin-report.json
uses: actions/cache/save@v4
with:
path: tenbin-report.json
key: tenbin-report-${{ github.run_id }}