Repository navigation
120 lines (97 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
120 lines (97 loc) · 2.95 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BUN_VERSION: '1.3.6'
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
# bun.lock is gitignored in this repo, so cache the global module cache
# keyed on package.json instead of a lockfile hash.
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('package.json') }}
restore-keys: ${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Run tests
run: bun run test
build:
name: Build bundle
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('package.json') }}
restore-keys: ${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
- name: Verify build output is unpatched
# scripts/build.ts temporarily rewrites feature() gates in src/ and
# restores them afterwards. A dirty tree means the restore failed.
run: git diff --exit-code -- src
- name: Smoke test CLI
run: |
bun dist/cli.js -v | tee /tmp/version.txt
grep -q 'Claude Code' /tmp/version.txt
bun dist/cli.js --help > /dev/null
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: cli-bundle
path: |
dist/cli.js
dist/*.md
retention-days: 14
if-no-files-found: error
build-binary:
name: Build standalone binary
# Expensive (~124 MB executable) — only on manual dispatch.
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('package.json') }}
restore-keys: ${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Build binary
run: bun run build:binary
- name: Smoke test binary
run: ./dist/claude -v
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: claude-linux-x64
path: dist/claude
retention-days: 14
if-no-files-found: error