Skip to content

Commit 73852bc

Browse files
anandgupta42claude
andauthored
ci: add Verdaccio sanity suite to CI and release workflows (#560)
Adds the Verdaccio-based sanity suite (real `npm install -g` flow) to both CI and release pipelines: **CI (`ci.yml`):** - New `sanity-verdaccio` job on push to main - Builds linux-x64 binary + dbt-tools, runs full Docker Compose suite - Independent of other jobs (doesn't block PRs) **Release (`release.yml`):** - New `sanity-verdaccio` job between build and npm publish - Downloads linux-x64 artifact from build matrix - **Blocks `publish-npm`** — broken install flow prevents release - Dependency chain: build → sanity-verdaccio → publish-npm → github-release Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b09012a commit 73852bc

3 files changed

Lines changed: 107 additions & 4 deletions

File tree

.github/meta/commit.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
fix: remove flaky `setTimeout` in todo bus event test
1+
ci: add Verdaccio sanity suite to CI and release workflows
22

3-
`Bus.publish` is synchronous — the event is delivered immediately,
4-
no 50ms delay needed. Removes resource contention risk in parallel CI.
3+
Adds the Verdaccio-based sanity suite (real `npm install -g` flow)
4+
to both CI and release pipelines:
5+
6+
**CI (`ci.yml`):**
7+
- New `sanity-verdaccio` job on push to main
8+
- Builds linux-x64 binary + dbt-tools, runs full Docker Compose suite
9+
- Independent of other jobs (doesn't block PRs)
10+
11+
**Release (`release.yml`):**
12+
- New `sanity-verdaccio` job between build and npm publish
13+
- Downloads linux-x64 artifact from build matrix
14+
- **Blocks `publish-npm`** — broken install flow prevents release
15+
- Dependency chain: build → sanity-verdaccio → publish-npm → github-release
516

617
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,53 @@ jobs:
329329
DBT_E2E_VERSIONS: "1.8,1.10,1.11"
330330
DBT_RESOLVE_SCENARIOS: "venv,uv,system"
331331

332+
# ---------------------------------------------------------------------------
333+
# Verdaccio sanity suite — tests the real `npm install -g` flow.
334+
# Only on push to main (too slow for PRs, needs Docker Compose).
335+
# Catches publish-pipeline bugs: missing files, broken symlinks, wrong bin
336+
# field, dependency resolution failures, postinstall script issues.
337+
# ---------------------------------------------------------------------------
338+
sanity-verdaccio:
339+
name: Sanity (Verdaccio)
340+
needs: changes
341+
if: github.event_name == 'push'
342+
runs-on: ubuntu-latest
343+
timeout-minutes: 30
344+
steps:
345+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
346+
347+
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
348+
with:
349+
bun-version: "1.3.10"
350+
351+
- name: Cache Bun dependencies
352+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
353+
with:
354+
path: ~/.bun/install/cache
355+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
356+
restore-keys: |
357+
bun-${{ runner.os }}-
358+
359+
- name: Install dependencies
360+
run: bun install
361+
362+
- name: Build CLI binary
363+
run: bun run packages/opencode/script/build.ts --target-index=1
364+
env:
365+
OPENCODE_VERSION: 0.0.0-sanity-${{ github.sha }}
366+
MODELS_DEV_API_JSON: test/tool/fixtures/models-api.json
367+
368+
- name: Build dbt-tools
369+
run: bun run build
370+
working-directory: packages/dbt-tools
371+
372+
- name: Run Verdaccio sanity suite
373+
run: |
374+
docker compose -f test/sanity/docker-compose.verdaccio.yml up \
375+
--build --abort-on-container-exit --exit-code-from sanity
376+
env:
377+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
378+
332379
marker-guard:
333380
name: Marker Guard
334381
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,54 @@ jobs:
125125
path: packages/opencode/dist/
126126
compression-level: 1
127127

128+
# ---------------------------------------------------------------------------
129+
# Verdaccio sanity suite — tests the real `npm install -g` flow BEFORE
130+
# publishing to npm. Catches broken symlinks, missing files, postinstall
131+
# failures, and dependency resolution issues that smoke tests miss.
132+
# ---------------------------------------------------------------------------
133+
sanity-verdaccio:
134+
name: Sanity (Verdaccio)
135+
needs: build
136+
runs-on: ubuntu-latest
137+
timeout-minutes: 30
138+
steps:
139+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
140+
141+
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
142+
with:
143+
bun-version: "1.3.10"
144+
145+
- name: Cache Bun dependencies
146+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
147+
with:
148+
path: ~/.bun/install/cache
149+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
150+
restore-keys: |
151+
bun-${{ runner.os }}-
152+
153+
- name: Install dependencies
154+
run: bun install
155+
156+
- name: Download linux-x64 build artifact
157+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
158+
with:
159+
name: dist-linux-x64
160+
path: packages/opencode/dist/
161+
162+
- name: Build dbt-tools
163+
run: bun run build
164+
working-directory: packages/dbt-tools
165+
166+
- name: Run Verdaccio sanity suite
167+
run: |
168+
docker compose -f test/sanity/docker-compose.verdaccio.yml up \
169+
--build --abort-on-container-exit --exit-code-from sanity
170+
env:
171+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
172+
128173
publish-npm:
129174
name: Publish to npm
130-
needs: build
175+
needs: [build, sanity-verdaccio]
131176
runs-on: ubuntu-latest
132177
timeout-minutes: 60
133178
permissions:

0 commit comments

Comments
 (0)