Commit 0dd2495
committed
ci: build swift helper before bun test
The Swift helper binary is imported at module-load time via Bun's
`with { type: "file" }` attribute in `src/mac/helper.ts`. Tests that
spawn the swrag CLI as a subprocess (tests/cli.test.ts) or import the
helper module directly (tests/mac/*, tests/bootstrap.test.ts,
tests/doctor.test.ts) fail with "Cannot find module" if the binary
isn't on disk when `bun test` boots.
Locally this works because the developer ran `bun run build` (or
`scripts/build-swift-helper.sh`) at least once. CI never did — both
`ci.yml` and `release.yml` only built the helper inside `bun run build`
which executes AFTER `bun test`. The v0.7.0 release workflow run
exposed this: 10 fail / 7 unhandled-error tests with "Cannot find
module '../../vendor/swrag-helper-darwin-universal'".
Build the helper explicitly between the fixture / dylib steps and the
test step in both workflows.1 parent 188fac2 commit 0dd2495
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
0 commit comments