-
Notifications
You must be signed in to change notification settings - Fork 18
84 lines (72 loc) · 2.09 KB
/
test.yaml
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
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
paths-ignore:
- "examples/**"
- "README.md"
- "release-process.md"
- "templates/**"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build spinjs
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Install latest Rust stable toolchain
shell: bash
run: |
rustup toolchain install stable --component clippy --component rustfmt
rustup default stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-lint-${{ hashFiles('./Cargo.lock') }}"
cache-on-failure: "true"
- name: "Install Wasm Rust target"
shell: bash
run: rustup target add wasm32-wasi
- name: Install nodejs
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.25.x'
- name: Setup WASI-SDK
shell: bash
run: |
cd /tmp
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz
tar -xvf wasi-sdk-16.0-linux.tar.gz
cp -v -r wasi-sdk-16.0 /opt/wasi-sdk
- name: Install NPM dependancies for SDK
shell: bash
run: |
cd crates/spin-js-engine/src/js_sdk
npm install
- name: Lint
shell: bash
run: |
cargo fmt --all -- --check
make crates/spin-js-engine/sdk.ts
QUICKJS_WASM_SYS_WASI_SDK_PATH=/opt/wasi-sdk cargo clippy --all-targets --all-features
- name: Build spinjs
shell: bash
run: make
- name: Install spin
uses: engineerd/[email protected]
with:
name: "spin"
url: "https://github.com/fermyon/spin/releases/download/canary/spin-canary-linux-amd64.tar.gz"
pathInArchive: "spin"
- name: Run Test
shell: bash
run: |
cd test
./test.sh