-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (183 loc) · 6.54 KB
/
ci.yml
File metadata and controls
212 lines (183 loc) · 6.54 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
name: ci
on:
pull_request:
paths-ignore:
- "docs/**"
- "README.md"
- "AGENTS.md"
- ".codex/**"
- ".opencode/**"
push:
branches:
- main
paths-ignore:
- "docs/**"
- "README.md"
- "AGENTS.md"
- ".codex/**"
- ".opencode/**"
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
stage-1-quality:
name: Stage 1 - Quality
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'chore/bump-version-')
runs-on: blacksmith-2vcpu-ubuntu-2404
env:
PUBLIC_CONVEX_URL: "https://example.convex.cloud"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.11
- name: Cache Bun + Turbo
uses: actions/cache@v5
with:
path: |
~/.bun/install/cache
.turbo
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-bun-turbo-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Ultracite check
run: bun x ultracite check
- name: Core manual inference tests
run: |
bun test \
packages/backend/convex/manualInferenceLogic.test.ts \
apps/web/src/lib/capability.test.ts \
apps/web/src/lib/mappers.test.ts
- name: Publish summary
if: always()
run: |
echo "## Stage 1 - Quality" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- ultracite check" >> "$GITHUB_STEP_SUMMARY"
echo "- deterministic manual inference + mapping tests" >> "$GITHUB_STEP_SUMMARY"
stage-2-browser-qa:
name: Stage 2 - Browser QA
needs: stage-1-quality
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'chore/bump-version-')
runs-on: blacksmith-2vcpu-ubuntu-2404
env:
PUBLIC_CONVEX_URL: "https://example.convex.cloud"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.11
- name: Cache Bun + Turbo
uses: actions/cache@v5
with:
path: |
~/.bun/install/cache
.turbo
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-bun-turbo-
- name: Cache Playwright browsers
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install agent-browser CLI
run: npm install -g agent-browser@latest
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: Run local browser QA smoke
run: bun run qa:browser
- name: Upload browser QA artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: browser-qa-local-${{ github.run_id }}-${{ github.run_attempt }}
path: artifacts/browser-qa/**
if-no-files-found: error
- name: Publish summary
if: always()
run: |
echo "## Stage 2 - Browser QA" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- local agent-browser smoke flow" >> "$GITHUB_STEP_SUMMARY"
echo "- screenshots uploaded as workflow artifact" >> "$GITHUB_STEP_SUMMARY"
echo "- Browserbase replay runs on the preview-validation workflow" >> "$GITHUB_STEP_SUMMARY"
stage-3-build:
name: Stage 3 - Build
needs: stage-2-browser-qa
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'chore/bump-version-')
runs-on: blacksmith-4vcpu-ubuntu-2404
env:
PUBLIC_CONVEX_URL: "https://example.convex.cloud"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.11
- name: Cache Bun + Turbo
uses: actions/cache@v5
with:
path: |
~/.bun/install/cache
.turbo
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock', '**/bun.lockb', 'package.json', 'apps/**/package.json', 'packages/**/package.json') }}
restore-keys: |
${{ runner.os }}-bun-turbo-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- name: TUI compile smoke test
run: |
mkdir -p apps/tui/dist
bun build apps/tui/src/index.tsx --compile --outfile apps/tui/dist/cable-intel-tui
./apps/tui/dist/cable-intel-tui --help
- name: Publish summary
if: always()
run: |
echo "## Stage 3 - Build" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- workspace build" >> "$GITHUB_STEP_SUMMARY"
echo "- TUI compile smoke test" >> "$GITHUB_STEP_SUMMARY"
checks:
name: checks
if: always()
needs:
- stage-1-quality
- stage-2-browser-qa
- stage-3-build
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Skip staged CI for automated release PRs
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'chore/bump-version-')
run: echo "Automated version-bump PR; staged CI is intentionally skipped."
- name: Finalize staged CI result
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'chore/bump-version-')
run: |
if [ "${{ needs.stage-1-quality.result }}" != "success" ]; then
echo "Stage 1 failed."
exit 1
fi
if [ "${{ needs.stage-2-browser-qa.result }}" != "success" ]; then
echo "Stage 2 failed."
exit 1
fi
if [ "${{ needs.stage-3-build.result }}" != "success" ]; then
echo "Stage 3 failed."
exit 1
fi
echo "All CI stages passed."