Repository navigation
136 lines (108 loc) · 3.6 KB
/
Copy pathci.yml
File metadata and controls
136 lines (108 loc) · 3.6 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
pull_request:
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
actions: read
jobs:
quality:
name: lint + typecheck + build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:skill-assets
- run: pnpm -r --filter "./packages/*" build
- run: pnpm run check
test:
name: test shard ${{ matrix.shard }}/4
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: pnpm
# Every shard keeps the real Node/Bun/compiled-binary coverage.
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:skill-assets
- run: pnpm -r --filter "./packages/*" build
- name: Run test shard
run: >-
pnpm exec vp test --shard=${{ matrix.shard }}/4
--reporter=default --reporter=blob --reporter=json
--outputFile.blob=.ci-test-results/blob/shard-${{ matrix.shard }}.json
--outputFile.json=.ci-test-results/json/shard-${{ matrix.shard }}.json
- name: Upload shard reports
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: test-shard-${{ matrix.shard }}
path: .ci-test-results/
include-hidden-files: true
if-no-files-found: error
retention-days: 3
# Keep the existing required-check identity. Upstream failure/skip/cancellation
# must produce a failing check, rather than silently skipping the gate.
check:
name: lint + typecheck + test
if: ${{ always() }}
needs: [quality, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Download shard reports
id: download
uses: actions/download-artifact@v8
with:
pattern: test-shard-*
path: .ci-test-results
merge-multiple: true
# list --filesOnly discovers the full inventory, independently of sharding.
- name: Discover complete test inventory
run: pnpm exec vp test list --filesOnly --json=.ci-test-inventory.json
- name: Verify complete shard coverage
if: ${{ always() }}
env:
QUALITY_RESULT: ${{ needs.quality.result }}
TEST_RESULT: ${{ needs.test.result }}
run: >-
node tools/ci/verify-shard-reports.mjs
--reports .ci-test-results --inventory .ci-test-inventory.json --shards 4
- name: Merge test reports
if: ${{ always() && steps.download.outcome == 'success' }}
run: >-
pnpm exec vp test --mergeReports=.ci-test-results/blob
--reporter=default --reporter=json --outputFile.json=.ci-test-summary.json
- name: Upload merged report
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: test-summary
path: .ci-test-summary.json
include-hidden-files: true
retention-days: 3