Repository navigation
67 lines (57 loc) · 2.29 KB
/
Copy pathci.yml
File metadata and controls
67 lines (57 loc) · 2.29 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
# CI: cross-platform build + test for the ner-jarvis CLI.
#
# Note: src/payload.generated.ts is git-ignored, so a fresh checkout does not
# have it. `bun test` imports it (via loadPayload), so we MUST run `bun run embed`
# BEFORE `bun test` and before any build. (The build scripts embed internally too,
# but the standalone test step needs the explicit embed first.)
name: CI
on:
push:
branches-ignore: [context-workspace] # just context/; the sync workflow covers it
pull_request:
branches: [main]
jobs:
test:
defaults:
run:
working-directory: cli
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2
- name: Install dependencies
run: bun install
# payload.generated.ts is git-ignored — generate it before test/build.
- name: Embed payload
run: bun run embed
# context/README.md's "Start here" table is generated from roster.json.
- name: Check context README is in sync with the roster
run: bun run sync:context --check
# The context-workspace branch needs its own copy of the sync workflow (see sync-context-workspace.yml).
- name: Check the context workspace's sync workflow matches main's
shell: bash
run: cmp ../.github/workflows/sync-context-workspace.yml ../context/.github/workflows/sync-context-workspace.yml
# --timeout: the default 5s is too tight on windows-latest, where each
# `claude` spawn costs a few hundred ms and a full setup run makes dozens.
- name: Test
run: bun test --timeout 30000
- name: Build host binary
run: bun run build:binary
# Cross-platform smoke test: the host binary is always dist/ner-jarvis
# (no `.exe` suffix, even on Windows). `shell: bash` makes the same
# command work on ubuntu, macos, and windows runners.
- name: Smoke test built binary
shell: bash
run: |
version="$(./dist/ner-jarvis --version)"
echo "ner-jarvis --version -> $version"
if [ -z "$version" ]; then
echo "::error::--version printed nothing"
exit 1
fi