Repository navigation
740 lines (645 loc) · 31 KB
/
Copy pathci.yml
File metadata and controls
740 lines (645 loc) · 31 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
name: CI
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
# `labeled` lets the ci:full-matrix label retrigger CI; concurrency cancel-in-progress absorbs bot-label churn.
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
ci-mode:
runs-on: ubuntu-latest
outputs:
generated_release_push: ${{ steps.classify.outputs.generated_release_push }}
web_only: ${{ steps.classify.outputs.web_only }}
run_heavy: ${{ steps.classify.outputs.run_heavy }}
full_matrix: ${{ steps.classify.outputs.full_matrix }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Classify CI mode
id: classify
shell: bash
env:
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message || '' }}
HEAD_REF: ${{ github.head_ref || '' }}
PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) || '[]' }}
run: |
set -euo pipefail
PATHS_FILE="$RUNNER_TEMP/ci-changed-paths"
DIFF_AVAILABLE=true
if [ -z "$BASE_SHA" ] ||
[ "$BASE_SHA" = "0000000000000000000000000000000000000000" ] ||
! git cat-file -e "${BASE_SHA}^{commit}" 2>/dev/null ||
! git diff --name-only -z "$BASE_SHA" "$GITHUB_SHA" > "$PATHS_FILE"; then
DIFF_AVAILABLE=false
: > "$PATHS_FILE"
fi
MERGE_PARENTS="$(git show -s --format=%P "$GITHUB_SHA" | wc -w)"
MODE_JSON="$(node script/ci-fast-path.mjs \
--event "$GITHUB_EVENT_NAME" \
--message "$HEAD_COMMIT_MESSAGE" \
--diff-available "$DIFF_AVAILABLE" \
--merge-parents "$MERGE_PARENTS" \
--head-ref "$HEAD_REF" \
--labels "${PR_LABELS:-[]}" \
< "$PATHS_FILE")"
jq -r '"generated_release_push=\(.generatedReleasePush)"' <<< "$MODE_JSON" >> "$GITHUB_OUTPUT"
jq -r '"web_only=\(.webOnly)"' <<< "$MODE_JSON" >> "$GITHUB_OUTPUT"
jq -r '"run_heavy=\(.runHeavy)"' <<< "$MODE_JSON" >> "$GITHUB_OUTPUT"
jq -r '"full_matrix=\(.fullMatrix)"' <<< "$MODE_JSON" >> "$GITHUB_OUTPUT"
jq . <<< "$MODE_JSON"
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: CI execution mode
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Generated release push: `${{ steps.classify.outputs.generated_release_push || 'unknown' }}`.
- Web-only change: `${{ steps.classify.outputs.web_only || 'unknown' }}`.
- Run heavy validation: `${{ steps.classify.outputs.run_heavy || 'unknown' }}`.
- Full 3-OS matrix: `${{ steps.classify.outputs.full_matrix || 'unknown' }}` (false keeps heavy work on ubuntu; add the `ci:full-matrix` label to force it).
JOB_SUMMARY_NEXT: Classification failures default to heavy validation on the full matrix; inspect the changed-path diff and event metadata.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
# Block PRs targeting master branch (comment + auto-close, then fail the check)
block-master-pr:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: Check PR target branch
env:
BASE_REF: ${{ github.base_ref }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
if [ "$BASE_REF" != "master" ]; then
echo "PR targets '${BASE_REF}' branch - OK"
exit 0
fi
echo "::error::PRs to master branch are not allowed. Please target the 'dev' branch instead."
gh pr comment "$PR_URL" --body "$(cat <<EOF
Hi @${PR_AUTHOR}, thanks for the contribution!
This repository does not accept pull requests that target the \`master\` branch, so this PR is being closed automatically.
**What to do instead:**
1. Re-target (or recreate) this PR against the \`dev\` branch.
2. All changes land on \`dev\` first; \`master\` is updated only by the release workflow.
No worries, nothing is lost. Just open a new PR against \`dev\` and we'll take it from there. Thanks again!
EOF
)"
gh pr close "$PR_URL"
echo "PR was auto-closed because it targeted 'master'."
exit 1
- name: Write job summary
if: always()
run: |
{
echo "## PR target guard"
echo
echo "| Field | Value |"
echo "| --- | --- |"
echo "| Result | \`${{ job.status }}\` |"
echo "| Workflow | \`${{ github.workflow }}\` |"
echo "| Event | \`${{ github.event_name }}\` |"
echo "| Base branch | \`${{ github.base_ref || 'n/a' }}\` |"
echo
echo "### What this job checks"
echo
echo "- Blocks pull requests that target \`master\`."
echo "- Leaves non-master pull requests alone."
echo
echo "### If this fails"
echo
echo "Retarget the pull request to \`dev\`; release automation owns \`master\`."
} >> "$GITHUB_STEP_SUMMARY"
test:
needs: [ci-mode]
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.os == 'windows-latest' && 60 || 30 }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
shard: "1/2"
- os: ubuntu-latest
shard: "2/2"
- os: macos-latest
shard: "1/2"
- os: macos-latest
shard: "2/2"
- os: windows-latest
shard: "1/2"
- os: windows-latest
shard: "2/2"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
# and 1.3.12 hangs on windows-latest in the ast-grep install-script
# timeout race.
bun-version: "1.4.0"
- uses: actions/cache@v6
if: runner.os != 'Windows' && needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun install --frozen-lockfile
- name: Remove stale self-package test copies
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun run script/remove-stale-self-package-tests.ts
# The full install runs the root `prepare` (`bun run build`), whose
# `build:lsp-daemon` step already runs `npm ci && npm run build` in
# packages/lsp-daemon, so its node_modules and dist exist before the tests.
- name: Run vendored lsp-daemon tests
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: npm test
working-directory: packages/lsp-daemon
# Every OS splits the root suite into two parallel jobs (the Windows
# shape): shard 1 runs omo-opencode + memory-core in one serial process,
# shard 2 runs the shared serial quarantine first and then the remainder.
# `bun test --parallel` is not used on POSIX: --isolate re-runs the heavy
# preload per file and OOM-kills the 7 GB runners, and --no-isolate leaks
# module state between files. Job-level sharding is the parallelism.
- name: Run tests
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.shard == '1/2' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun test packages/omo-opencode packages/memory-core
- name: Run tests
if: needs.ci-mode.outputs.run_heavy == 'true' && runner.os != 'Windows' && matrix.shard == '2/2' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: |
bun test packages/senpi-task/src/runners/rpc-process.windows.test.ts packages/senpi-task/src/__adversarial__/chaos-bench.test.ts packages/omo-codex/src/install/install-codex-legacy-agent-purge.test.ts script/codex-installer-version.test.ts packages/shared-skills/provenance-gate.test.ts packages/omo-codex/src/install/install-codex-mcp-manifest.test.ts packages/senpi-task/src/dag/scheduler.test.ts packages/omo-native/test/payload.test.ts script/build-omo-binary.test.ts
bun --config=bunfig.win2.parallel.toml test
# Git Bash sets SHELL/MSYSTEM on Windows, which makes process-platform
# tests observe sh instead of the native PowerShell/cmd execution path.
- name: Run tests
if: needs.ci-mode.outputs.run_heavy == 'true' && runner.os == 'Windows' && matrix.shard == '2/2' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
shell: pwsh
run: |
bun test packages/senpi-task/src/runners/rpc-process.windows.test.ts packages/senpi-task/src/__adversarial__/chaos-bench.test.ts packages/omo-codex/src/install/install-codex-legacy-agent-purge.test.ts script/codex-installer-version.test.ts packages/shared-skills/provenance-gate.test.ts packages/omo-codex/src/install/install-codex-mcp-manifest.test.ts packages/senpi-task/src/dag/scheduler.test.ts packages/omo-native/test/payload.test.ts script/build-omo-binary.test.ts
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
bun --config=bunfig.win2.parallel.toml test --parallel
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Root test suite (${{ matrix.os }}${{ matrix.shard && format(', shard {0}', matrix.shard) || '' }})
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds vendored LSP packages before tests.
- Runs `npm test` for `packages/lsp-daemon`.
- Runs all non-Senpi root tests sharded two ways per OS: shard 1 covers omo-opencode + memory-core, shard 2 runs the shared serial quarantine first and then the remainder (serial on POSIX, `--parallel` on Windows).
- Splits every OS by the same package groups so global zauc mock bootstraps stay with their consumers.
JOB_SUMMARY_NEXT: Open the first failing test or package-build step; matrix failures are usually OS-specific.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
typecheck:
needs: [ci-mode]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun install --frozen-lockfile --ignore-scripts
- name: Type check
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun run typecheck
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: TypeScript checks (ubuntu-latest)
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds vendored LSP packages required by the workspace.
- Runs root `bun run typecheck`, including script and package checks.
JOB_SUMMARY_NEXT: Start with the first TypeScript diagnostic; shared package failures can cascade into adapters.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
codex-compatibility:
needs: [ci-mode]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
suite: full
- os: macos-latest
suite: platform
- os: windows-latest
suite: platform
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun install --frozen-lockfile --ignore-scripts
- name: Run full Codex compatibility suite
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.suite == 'full' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun run test:codex
- name: Run omo-codex component checks
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.suite == 'full' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
shell: bash
run: |
set -uo pipefail
status=0
for component in packages/omo-codex/plugin/components/*/; do
if jq -e '.scripts.check' "${component}package.json" > /dev/null 2>&1; then
echo "::group::Component check: ${component}"
npm --prefix "$component" run check || status=1
echo "::endgroup::"
fi
done
exit $status
- name: Build Codex platform smoke prerequisites
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.suite == 'platform' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: |
bun run build:codex-install
bun run build:git-bash-mcp
bun run build:lsp-tools-mcp
bun run build:lsp-daemon
npm --prefix packages/omo-codex/plugin ci
bun run --cwd packages/omo-codex/plugin build
- name: Run Codex platform smoke tests (.mjs via node --test)
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.suite == 'platform' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: >-
node --test
packages/omo-codex/scripts/install-local.test.mjs
packages/omo-codex/scripts/install-local-entrypoint.test.mjs
packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs
packages/omo-codex/scripts/install-cli-args.test.mjs
packages/omo-codex/plugin/test/node-install-surface.test.mjs
packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs
- name: Run Codex platform smoke tests (.ts via bun test)
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.suite == 'platform' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Codex compatibility (${{ matrix.os }}, ${{ matrix.suite }})
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds the MCP runtimes needed by the Codex adapter.
- Runs the full hermetic Codex gate plus every omo-codex component check script on Linux, and platform-specific installer/path/shell smoke tests on macOS and Windows.
- Preserves Linux, macOS, and Windows platform compatibility coverage without duplicating platform-neutral tests.
JOB_SUMMARY_NEXT: Inspect the failing component build or the first Codex compatibility test failure for this OS.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
senpi-compatibility:
needs: [ci-mode]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun install --frozen-lockfile --ignore-scripts
- name: Remove stale self-package test copies
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
run: bun run script/remove-stale-self-package-tests.ts
# Linux only: digestBuildSources hashes repo-relative paths (build-extension.mjs:140,143),
# which are backslash-separated on Windows, so the source digest is platform-dependent and
# a committed artifact can never match on every OS. One platform is enough to catch drift.
- name: Verify committed Senpi plugin bundle is current
if: needs.ci-mode.outputs.run_heavy == 'true' && matrix.os == 'ubuntu-latest'
shell: bash
run: |
set -euo pipefail
node packages/omo-senpi/plugin/scripts/build-extension.mjs --check
- name: Run Senpi compatibility tests
if: needs.ci-mode.outputs.run_heavy == 'true' && (matrix.os == 'ubuntu-latest' || needs.ci-mode.outputs.full_matrix == 'true')
shell: bash
run: |
set -euo pipefail
bun run build:senpi-plugin
PACK_DIR="$RUNNER_TEMP/omo-senpi-pack"
mkdir -p "$PACK_DIR"
npm pack --pack-destination "$PACK_DIR" packages/omo-senpi/plugin
npm --prefix packages/lsp-daemon test -- test/daemon-roundtrip.test.ts
bunx tsgo --noEmit -p packages/omo-senpi/tsconfig.json
bun test ./.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs
bun test packages/omo-senpi
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Senpi compatibility (${{ matrix.os }})
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds the local-path Senpi adapter package artifacts.
- Builds the shared LSP daemon once before staging Senpi artifacts.
- Packs the generated Pi package and runs hermetic Senpi and QA-contract tests.
- Covers Linux/macOS socket and Windows named-pipe daemon smoke.
JOB_SUMMARY_NEXT: Inspect the first omo-senpi build, sync, directive, or package test failure for this OS.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
lazycodex-published-smoke:
needs: [ci-mode]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
bun-version: "1.4.0"
- name: Run published lazycodex-ai smoke commands
if: needs.ci-mode.outputs.run_heavy == 'true'
env:
HOME: ${{ runner.temp }}/lazycodex-published-smoke/home
CODEX_HOME: ${{ runner.temp }}/lazycodex-published-smoke/codex
CODEX_LOCAL_BIN_DIR: ${{ runner.temp }}/lazycodex-published-smoke/bin
run: |
set -euo pipefail
SMOKE_DIR=$(mktemp -d)
trap 'rm -rf "$SMOKE_DIR"' EXIT
mkdir -p "$HOME" "$CODEX_HOME" "$CODEX_LOCAL_BIN_DIR" "$SMOKE_DIR/cwd"
cd "$SMOKE_DIR/cwd"
npx_install_output=$(npx -y lazycodex-ai@latest --dry-run install --no-tui --codex-autonomous)
echo "$npx_install_output"
if [ "$npx_install_output" != "npx --yes oh-my-openagent@latest install --platform=codex --no-tui --codex-autonomous" ]; then
echo "::warning::lazycodex-ai install dry-run output changed: $npx_install_output"
fi
npx_doctor_output=$(npx -y lazycodex-ai@latest --dry-run doctor)
echo "$npx_doctor_output"
if [[ "$npx_doctor_output" != codex\ exec\ * ]] ||
[[ "$npx_doctor_output" != *"--sandbox danger-full-access"* ]] ||
[[ "$npx_doctor_output" != *'Use $omo:lcx-doctor'* ]] ||
[[ "$npx_doctor_output" == *"--model"* ]] ||
[[ "$npx_doctor_output" == *"gpt-5.5-codex-mini"* ]]; then
echo "::warning::lazycodex-ai doctor dry-run output changed: $npx_doctor_output"
fi
- name: Write job summary
if: always()
run: |
{
echo "## Published LazyCodex smoke"
echo
echo "| Field | Value |"
echo "| --- | --- |"
echo "| Result | \`${{ job.status }}\` |"
echo "| Workflow | \`${{ github.workflow }}\` |"
echo "| Event | \`${{ github.event_name }}\` |"
echo "| Ref | \`${{ github.ref_name }}\` |"
echo
echo "### What this job checks"
echo
echo "- Runs non-blocking smoke checks against \`lazycodex-ai@latest\`."
echo "- Verifies dry-run install and doctor command routing from an isolated temp directory."
echo
echo "### If this fails"
echo
echo "Treat warnings as registry or alias drift signals; this job is intentionally non-blocking."
} >> "$GITHUB_STEP_SUMMARY"
build:
needs: [ci-mode]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun install --frozen-lockfile --ignore-scripts
- name: Build
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun run build
- name: Verify build output
if: needs.ci-mode.outputs.run_heavy == 'true'
run: |
test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1)
test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1)
- name: Verify dist bundle tests
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun test packages/omo-opencode/src/shared/dist-bundle-bun-globals.test.ts packages/omo-opencode/src/shared/dist-bundle-prompt-content.test.ts
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Root build
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds the distributable OpenCode/Codex packages.
- Confirms `dist/index.js` and `dist/index.d.ts` exist.
- Runs dist bundle regression tests.
JOB_SUMMARY_NEXT: Fix the first failing build prerequisite before debugging downstream dist checks.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
omo-ai-payload-check:
needs: [ci-mode]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
if: needs.ci-mode.outputs.run_heavy == 'true'
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun install --frozen-lockfile
- name: Build omo-native
if: needs.ci-mode.outputs.run_heavy == 'true'
run: bun run build:omo-native
- name: Verify omo-ai payload
if: needs.ci-mode.outputs.run_heavy == 'true'
run: node script/verify-omo-ai-payload.mjs
- name: Dry-run publish
if: needs.ci-mode.outputs.run_heavy == 'true'
run: npm publish --dry-run --ignore-scripts --tag beta
working-directory: packages/omo-native
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: omo-ai payload check
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Builds the omo-native package.
- Verifies the omo-ai tarball payload whitelist.
- Runs `npm publish --dry-run` to confirm publishability without publishing.
JOB_SUMMARY_NEXT: Inspect the failing build, payload verifier, or dry-run publish step.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
auto-commit-schema:
runs-on: ubuntu-latest
needs: [ci-mode, test, typecheck, codex-compatibility, senpi-compatibility, build, omo-ai-payload-check]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-1.4.0-${{ hashFiles('bun.lock') }}
- name: Install dependencies
run: bun install --frozen-lockfile --ignore-scripts
- name: Build
run: bun run build
- name: Auto-commit schema changes
run: |
if git diff --quiet assets/oh-my-opencode.schema.json assets/omo.schema.json; then
echo "No schema changes to commit"
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add assets/oh-my-opencode.schema.json assets/omo.schema.json
git commit -m "chore: auto-update schema.json"
git push
fi
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Schema auto-commit
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Rebuilds the schema artifacts on `master` pushes.
- Commits `assets/oh-my-opencode.schema.json` and `assets/omo.schema.json` only when generation changes them.
JOB_SUMMARY_NEXT: If this fails, inspect schema generation first, then check bot write permissions.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh
draft-release:
runs-on: ubuntu-latest
needs: [ci-mode, test, typecheck, codex-compatibility, senpi-compatibility, build, omo-ai-payload-check]
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/dev' &&
needs.ci-mode.outputs.run_heavy == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
- name: Generate release notes
id: notes
run: |
NOTES=$(bun run script/generate-changelog.ts)
{
echo "notes<<EOF"
echo "$NOTES"
echo "EOF"
} >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create or update draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTES: ${{ steps.notes.outputs.notes }}
TARGET_SHA: ${{ github.sha }}
run: |
EXISTING_DRAFT=$(gh release list --json tagName,isDraft --jq '.[] | select(.isDraft == true and .tagName == "next") | .tagName')
if [ -n "$EXISTING_DRAFT" ]; then
echo "Updating existing draft release..."
gh release edit next \
--title "Upcoming Changes 🍿" \
--notes-file - \
--draft <<EOF
$NOTES
EOF
else
echo "Creating new draft release..."
gh release create next \
--title "Upcoming Changes 🍿" \
--notes-file - \
--draft \
--target "$TARGET_SHA" <<EOF
$NOTES
EOF
fi
- name: Write job summary
if: always()
shell: bash
env:
JOB_SUMMARY_TITLE: Draft release notes
JOB_SUMMARY_STATUS: ${{ job.status }}
JOB_SUMMARY_DETAILS: |
- Generates changelog notes from the current `dev` branch.
- Creates or updates the `next` draft release.
JOB_SUMMARY_NEXT: Check changelog generation output first, then GitHub release permissions.
run: GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" bash .github/scripts/write-job-summary.sh