forked from Yeachan-Heo/oh-my-codex
-
Notifications
You must be signed in to change notification settings - Fork 0
291 lines (276 loc) · 10.2 KB
/
Copy pathci.yml
File metadata and controls
291 lines (276 loc) · 10.2 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
name: CI
on:
push:
branches: [main, dev, experimental/dev]
pull_request:
branches: [main, dev, experimental/dev]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
rustfmt:
name: Rust Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check Rust formatting
run: cargo fmt --all --check
clippy:
name: Rust Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
typecheck:
name: Typecheck (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npx tsc --noEmit
- run: npm run check:no-unused
test:
name: Test (Node ${{ matrix.node-version }} / ${{ matrix.lane }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- node-version: 20
lane: full
- node-version: 22
lane: smoke
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- name: Run full suite
if: matrix.lane == 'full'
run: npm test
- name: Run cross-rebase smoke command
if: matrix.lane == 'smoke'
run: npm run test:team:cross-rebase-smoke
- name: Run remaining smoke suite
if: matrix.lane == 'smoke'
run: |
node --test \
dist/cli/__tests__/packaged-script-resolution.test.js \
dist/cli/__tests__/package-bin-contract.test.js \
dist/cli/__tests__/explore.test.js \
dist/cli/__tests__/sparkshell-cli.test.js \
dist/hooks/__tests__/explore-routing.test.js \
dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js \
dist/scripts/__tests__/smoke-packed-install.test.js \
dist/verification/__tests__/explore-harness-release-workflow.test.js \
dist/compat/__tests__/*.test.js
coverage-team-critical:
name: Coverage Gate (Team Critical)
runs-on: ubuntu-latest
needs: [typecheck]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run team/state coverage gate
run: npm run coverage:team-critical
- name: Add coverage summary to job summary
run: |
node -e '
const fs = require("node:fs");
const summary = JSON.parse(fs.readFileSync("coverage/team/coverage-summary.json", "utf8"));
const total = summary.total;
const lines = [
"## Team/State Coverage Summary",
"",
"| Metric | Pct | Covered / Total |",
"|---|---:|---:|",
`| Lines | ${total.lines.pct}% | ${total.lines.covered} / ${total.lines.total} |`,
`| Functions | ${total.functions.pct}% | ${total.functions.covered} / ${total.functions.total} |`,
`| Branches | ${total.branches.pct}% | ${total.branches.covered} / ${total.branches.total} |`,
`| Statements | ${total.statements.pct}% | ${total.statements.covered} / ${total.statements.total} |`
];
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${lines.join("\n")}\n`);
'
- name: Upload team coverage artifact
uses: actions/upload-artifact@v4
with:
name: team-critical-coverage
path: coverage/team/
coverage-ts-full:
name: Coverage Report (TypeScript Full)
runs-on: ubuntu-latest
needs: [typecheck]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run full TypeScript coverage report
run: npm run coverage:ts:full
- name: Add TypeScript coverage summary to job summary
run: |
node -e '
const fs = require("node:fs");
const summary = JSON.parse(fs.readFileSync("coverage/ts-full/coverage-summary.json", "utf8"));
const total = summary.total;
const lines = [
"## Full TypeScript Coverage Summary",
"",
"| Metric | Pct | Covered / Total |",
"|---|---:|---:|",
`| Lines | ${total.lines.pct}% | ${total.lines.covered} / ${total.lines.total} |`,
`| Functions | ${total.functions.pct}% | ${total.functions.covered} / ${total.functions.total} |`,
`| Branches | ${total.branches.pct}% | ${total.branches.covered} / ${total.branches.total} |`,
`| Statements | ${total.statements.pct}% | ${total.statements.covered} / ${total.statements.total} |`
];
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${lines.join("\n")}\n`);
'
- name: Upload full TypeScript coverage artifact
uses: actions/upload-artifact@v4
with:
name: ts-full-coverage
path: coverage/ts-full/
coverage-rust:
name: Coverage Report (Rust)
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate Rust coverage reports
shell: bash
run: |
mkdir -p coverage/rust
cargo llvm-cov --workspace --summary-only | tee coverage/rust/omx-explore-summary.txt
cargo llvm-cov --workspace --lcov --output-path coverage/rust/omx-explore.lcov
cargo llvm-cov --manifest-path crates/omx-sparkshell/Cargo.toml --summary-only | tee coverage/rust/omx-sparkshell-summary.txt
cargo llvm-cov --manifest-path crates/omx-sparkshell/Cargo.toml --lcov --output-path coverage/rust/omx-sparkshell.lcov
- name: Add Rust coverage summary to job summary
shell: bash
run: |
{
echo '## Rust Coverage Summary'
echo ''
echo '### omx-explore'
echo '```text'
cat coverage/rust/omx-explore-summary.txt
echo '```'
echo ''
echo '### omx-sparkshell'
echo '```text'
cat coverage/rust/omx-sparkshell-summary.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload Rust coverage artifact
uses: actions/upload-artifact@v4
with:
name: rust-coverage
path: coverage/rust/
ralph-persistence-gate:
name: Ralph Persistence Gate
runs-on: ubuntu-latest
needs: [typecheck]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- name: Run Ralph persistence verification matrix
run: |
node --test \
dist/cli/__tests__/session-scoped-runtime.test.js \
dist/mcp/__tests__/trace-server.test.js \
dist/hud/__tests__/state.test.js \
dist/mcp/__tests__/state-server-ralph-phase.test.js \
dist/ralph/__tests__/persistence.test.js \
dist/verification/__tests__/ralph-persistence-gate.test.js
build:
name: Build (Full Source Build)
runs-on: ubuntu-latest
needs: [rustfmt, clippy, lint, typecheck, test, ralph-persistence-gate]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- run: npm ci
- run: npm run build:full
ci-status:
name: CI Status
if: always()
runs-on: ubuntu-latest
needs: [rustfmt, clippy, lint, typecheck, test, coverage-team-critical, coverage-ts-full, coverage-rust, ralph-persistence-gate, build]
steps:
- name: Check required job results
run: |
if [[ "${{ needs.rustfmt.result }}" != "success" ]] ||
[[ "${{ needs.clippy.result }}" != "success" ]] ||
[[ "${{ needs.lint.result }}" != "success" ]] ||
[[ "${{ needs.typecheck.result }}" != "success" ]] ||
[[ "${{ needs.test.result }}" != "success" ]] ||
[[ "${{ needs.coverage-team-critical.result }}" != "success" ]] ||
[[ "${{ needs.coverage-ts-full.result }}" != "success" ]] ||
[[ "${{ needs.coverage-rust.result }}" != "success" ]] ||
[[ "${{ needs.ralph-persistence-gate.result }}" != "success" ]] ||
[[ "${{ needs.build.result }}" != "success" ]]; then
echo "::error::One or more required CI jobs failed"
echo " rustfmt: ${{ needs.rustfmt.result }}"
echo " clippy: ${{ needs.clippy.result }}"
echo " lint: ${{ needs.lint.result }}"
echo " typecheck: ${{ needs.typecheck.result }}"
echo " test: ${{ needs.test.result }}"
echo " coverage-team-critical: ${{ needs.coverage-team-critical.result }}"
echo " coverage-ts-full: ${{ needs.coverage-ts-full.result }}"
echo " coverage-rust: ${{ needs.coverage-rust.result }}"
echo " ralph-persistence-gate: ${{ needs.ralph-persistence-gate.result }}"
echo " build: ${{ needs.build.result }}"
exit 1
fi
echo "All required CI checks passed"