-
Notifications
You must be signed in to change notification settings - Fork 26
88 lines (72 loc) · 2.44 KB
/
ci.yml
File metadata and controls
88 lines (72 loc) · 2.44 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
typecheck-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# --- Rust / WASM build ---
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2026-03-01
targets: wasm32-wasip1
components: rust-src
- name: Install wasm-opt (binaryen)
run: sudo apt-get update && sudo apt-get install -y binaryen
- name: Cache WASM build artifacts
uses: actions/cache@v4
with:
path: |
native/wasmvm/target
native/wasmvm/vendor
key: wasm-${{ runner.os }}-${{ hashFiles('native/wasmvm/Cargo.lock', 'native/wasmvm/rust-toolchain.toml') }}
- name: Build WASM binary
run: cd native/wasmvm && make wasm
# --- C toolchain (wasi-sdk + patched sysroot + C test fixtures) ---
- name: Cache wasi-sdk
id: cache-wasi-sdk
uses: actions/cache@v4
with:
path: native/wasmvm/c/vendor/wasi-sdk
key: wasi-sdk-25-${{ runner.os }}-${{ runner.arch }}
- name: Download wasi-sdk
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
run: make -C native/wasmvm/c wasi-sdk
- name: Cache patched wasi-libc sysroot
id: cache-sysroot
uses: actions/cache@v4
with:
path: |
native/wasmvm/c/sysroot
native/wasmvm/c/vendor/wasi-libc
key: wasi-libc-sysroot-${{ runner.os }}-${{ hashFiles('native/wasmvm/patches/wasi-libc/*.patch', 'native/wasmvm/scripts/patch-wasi-libc.sh') }}
- name: Build patched wasi-libc sysroot
if: steps.cache-sysroot.outputs.cache-hit != 'true'
run: make -C native/wasmvm/c sysroot
- name: Build C test fixtures (WASM + native)
run: make -C native/wasmvm/c programs native
# --- Node.js / TypeScript ---
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.6
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm check-types
- name: Run tests
run: pnpm test