-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 1.52 KB
/
ci.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
name: CI workflow
on: [push]
jobs:
go-wasm-test:
runs-on: ubuntu-22.04
steps:
- name: Code checkout
uses: actions/checkout@v3
- name: Install Rust and rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '^1.18.3'
- name: Install Wabt (wat2wasm)
run: |
wget https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-ubuntu.tar.gz
tar -zxf wabt-1.0.29-ubuntu.tar.gz
sudo cp wabt-1.0.29/bin/wat2wasm /usr/local/bin
- name: Check go mod cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-owasmer-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-owasmer-
- name: Check cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-owasmer-${{ hashFiles('**/Cargo.lock') }}
- name: Build libgo_owasm
run: |
(cd libgo_owasm && cargo build --release)
cp libgo_owasm/target/release/libgo_owasm.so api/libgo_owasm.so
- name: Run rust tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path libgo_owasm/Cargo.toml --all
- name: Run go tests
run: go test ./...