Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

Commit 350b70d

Browse files
myobieclaude
andauthored
ci: add a vitest gate (full npm test) alongside the nix flake check (#100)
convoy CI ran only `nix flake check` — build + help/completions/typecheck + the completions-parity test, but NOT the full vitest suite (most of it shells out to `git worktree` / spawns bin/convoy, awkward in the hermetic nix sandbox). That left a gap: a red vitest test could ship green. Adds a Test workflow that runs `npm test` on a normal runner, gated on PRs + push-to-main. Modeled on pty's #114 test.yml, adapted for convoy's one real difference — the file:../ sibling deps (@compoundingtech/pty + smalltalk): the siblings are checked out beside convoy and built (convoy imports their dist/), zsh + fish are installed so the completion syntax checks actually run (rather than skip), then `npm install` links the siblings and `npm test` runs the suite. Claude-Session: https://claude.ai/code/session_01MCzqQKSpPiNX2ketyubByS Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ae77ec8 commit 350b70d

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# convoy's vitest gate. The Nix flake check (nix.yml) builds the binary and runs the help / completions /
2+
# typecheck checks + the completions-PARITY test — but NOT the full vitest suite. Most of that suite shells
3+
# out to `git worktree` (and spawns the real `bin/convoy`), which is awkward in the hermetic nix sandbox, so
4+
# it lives OUTSIDE the flake. That left a gap: a red vitest test could still be CI-green. This runs the whole
5+
# `npm test` on a normal runner so it can't.
6+
#
7+
# Modeled on pty's test.yml (#114), adapted for convoy's one real difference: convoy depends on
8+
# @compoundingtech/pty + @compoundingtech/smalltalk via `file:../<sibling>` paths. buildNpmPackage (nix)
9+
# links those from flake inputs; here we check the sibling repos out BESIDE convoy and build them (convoy
10+
# imports their compiled `dist/`), then `npm install` links them through the file: deps.
11+
name: Test
12+
13+
on:
14+
pull_request:
15+
push:
16+
branches: [main]
17+
18+
jobs:
19+
vitest:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 20
22+
steps:
23+
# convoy + its two file: siblings must be checked out side by side (../pty, ../smalltalk resolve
24+
# relative to the convoy checkout), so each goes in its own named path under the workspace.
25+
- uses: actions/checkout@v4
26+
with:
27+
path: convoy
28+
- uses: actions/checkout@v4
29+
with:
30+
repository: compoundingtech/pty
31+
path: pty
32+
- uses: actions/checkout@v4
33+
with:
34+
repository: compoundingtech/smalltalk
35+
path: smalltalk
36+
37+
- uses: actions/setup-node@v4
38+
with:
39+
# convoy needs Node >=23.6 — bin/convoy dynamically imports src/cli.ts and relies on native .ts
40+
# type-stripping (the subprocess tests spawn it). Matches the flake's nodejs_24.
41+
node-version: 24
42+
cache: npm
43+
cache-dependency-path: |
44+
convoy/package-lock.json
45+
pty/package-lock.json
46+
smalltalk/package-lock.json
47+
48+
- name: Install test-only shells (absent on ubuntu-latest)
49+
# completions.test.ts validates the GENERATED zsh/fish scripts with the real shells and SKIPS when
50+
# they're missing — so without these the zsh syntax check (which is exactly what catches a bad flag
51+
# description) silently no-ops. bash ships with the runner.
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y zsh fish
55+
56+
- name: Build the sibling deps (convoy imports their compiled dist/)
57+
run: |
58+
(cd pty && npm ci && npm run build)
59+
(cd smalltalk && npm ci && npm run build)
60+
61+
- name: Install convoy
62+
working-directory: convoy
63+
# `npm install`, not `npm ci`: the file: siblings are separate repos whose versions float ahead of
64+
# convoy's pinned lockfile, which would make `npm ci` fail on any sibling version bump. install
65+
# re-resolves the local links against whatever main is checked out.
66+
run: npm install
67+
68+
- name: Test
69+
working-directory: convoy
70+
# The cutWorktree tests run `git commit` in throwaway repos, which needs a committer identity.
71+
run: |
72+
git config --global user.email "ci@convoy.test"
73+
git config --global user.name "convoy CI"
74+
npm test

0 commit comments

Comments
 (0)