-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (47 loc) · 1.31 KB
/
main.yml
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
name: main
on:
push:
branches:
- main
jobs:
build:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: bahmutov/npm-install@v1
- name: prepare rust
run: |
export RUST_TOOLCHAIN=$(cat rust-toolchain)
rustup target add wasm32-wasi --toolchain ${RUST_TOOLCHAIN}
rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN}
rustup component add rustfmt --toolchain ${RUST_TOOLCHAIN}
rustup component add rust-src --toolchain ${RUST_TOOLCHAIN}-x86_64-unknown-linux-gnu
unset RUST_TOOLCHAIN
cd /
cargo install wasm-pack
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/cache/restore@v3
with:
path: |
deps/wasi-sdk
deps/emcc-sdk
key: ${{ runner.os }}-deps
- name: build, lint, and test
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
npm run build
npm run lint
npm test
- uses: actions/cache/save@v3
with:
path: |
deps/wasi-sdk
deps/emcc-sdk
key: ${{ runner.os }}-deps