1name: ci
2on:
3 push:
4 branches: [main]
5 pull_request:
7jobs:
8 test:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/checkout@v4
12 - uses: actions/setup-node@v4
13 with:
14 node-version: 24
15 cache: npm
16 # numbl is a `file:../../numbl` dependency: we use its compiler internals
17 # (parser, lowerer, IR, inline pass) and its interpreter, which its
18 # published package `exports` do not expose. Clone it where that relative
19 # path expects it. Pinned so a change to those internals cannot silently
20 # break the build — the surface we rely on is written down in
21 # src/mgpu/numbl.d.ts.
22 #
23 # numbl's own dependencies are NOT needed: the slice we import is
24 # self-contained TypeScript, verified by building against a checkout with no
25 # node_modules. One file in it is generated rather than committed, though —
26 # the interpreter's stdlib bundle, which numbl gitignores — so a bare
27 # checkout is missing it and `executeCode.ts` fails to resolve it. Its
28 # generator only reads .m files off disk, so plain `node` (type-stripping,
29 # unflagged since 22.18) runs it without installing anything.
30 - name: Check out numbl (sibling dependency)
31 env:
32 NUMBL_REF: main
33 run: |
34 git clone --filter=blob:none --no-checkout \
35 https://github.com/flatironinstitute/numbl.git "$GITHUB_WORKSPACE/../../numbl"
36 git -C "$GITHUB_WORKSPACE/../../numbl" checkout --quiet "$NUMBL_REF"
37 node "$GITHUB_WORKSPACE/../../numbl/scripts/bundle-stdlib.ts"
38 # --ignore-scripts: npm runs a linked package's `prepare` script, and
39 # numbl's is husky, which is not installed here.
40 - run: npm ci --ignore-scripts
41 - run: npm run build
42 # End-to-end check of the miss/compute/encode and hit/decode paths in
43 # headless Chrome on SwiftShader WebGPU, with the cloud cache mocked;
44 # the produced .h5 is verified with h5py.
45 - run: pip install h5py
46 - run: node scripts/check-app.mjs
47 env:
48 CHROME_PATH: /usr/bin/google-chrome