This repository was archived by the owner on Aug 7, 2026. It is now read-only.
Repository navigation
125 lines (104 loc) · 3.32 KB
/
Copy pathci.yml
File metadata and controls
125 lines (104 loc) · 3.32 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C target-feature=+simd128"
jobs:
build-wasm:
name: Build WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM (web target)
run: |
wasm-pack build crates/rumcodecs-wasm \
--target web \
--out-dir ../../pkg/rumcodecs-wasm \
--release
- name: Build WASM (nodejs target)
run: |
wasm-pack build crates/rumcodecs-wasm \
--target nodejs \
--out-dir ../../pkg/rumcodecs-wasm-node \
--release
- name: Upload WASM artifacts
uses: actions/upload-artifact@v7
with:
name: wasm-pkg
path: |
pkg/rumcodecs-wasm/
pkg/rumcodecs-wasm-node/
retention-days: 1
test:
name: Test (Node ${{ matrix.node-version }})
needs: build-wasm
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["22", "24"]
fail-fast: false
steps:
- uses: actions/checkout@v7
- name: Download WASM artifacts
uses: actions/download-artifact@v8
with:
name: wasm-pkg
path: pkg/
- name: Install vite+ (vp) and Node ${{ matrix.node-version }}
uses: voidzero-dev/setup-vp@v1
with:
node-version: ${{ matrix.node-version }}
cache: true
# The root `prepare` script rebuilds the WASM crates, which this job
# takes from the build-wasm artifact instead. Install is run below
# with scripts disabled so wasm-pack is not needed here.
run-install: false
- name: Install dependencies
run: vp install --ignore-scripts
- name: Run vitest
run: vp test --reporter=verbose
lint:
name: Lint & Typecheck
needs: build-wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Download WASM artifacts
uses: actions/download-artifact@v8
with:
name: wasm-pkg
path: pkg/
- name: Install vite+ (vp) and Node
uses: voidzero-dev/setup-vp@v1
with:
node-version: "22"
cache: true
# No `version` on purpose: the action reads the `vite-plus`
# devDependency and resolves it against pnpm-lock.yaml, so `vp check`
# here runs the same oxfmt as a local run. Letting it float to latest
# makes a new vp release fail formatting with no code change.
#
# See the note in the test job: WASM comes from the build artifact,
# so the `prepare` script must not run here.
run-install: false
- name: Install dependencies
run: vp install --ignore-scripts
- name: Check (format, lint, types)
run: vp check