-
-
Notifications
You must be signed in to change notification settings - Fork 48
70 lines (57 loc) · 1.81 KB
/
build.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build & Test
on:
push:
branches: main
pull_request:
branches: main
env:
WASI_VERSION: 12
WASI_VERSION_FULL: "12.0"
EMCC_VERSION: "1.40.1-fastcomp"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install wasi-sdk
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
export WASI_OS="linux";
fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
export WASI_OS="macos";
fi
if [[ "$RUNNER_OS" == "Windows" ]]; then
export WASI_OS="mingw";
fi
curl -sL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-${WASI_OS}.tar.gz -O
# check if package downloaded
ls -la
tar xvf wasi-sdk-${WASI_VERSION_FULL}-${WASI_OS}.tar.gz
# print clang version
./wasi-sdk-${WASI_VERSION_FULL}/bin/clang --version
- name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git --branch 3.1.29
cd ./emsdk
./emsdk install ${{ env.EMCC_VERSION }}
./emsdk activate ${{ env.EMCC_VERSION }}
./fastcomp/emscripten/emcc -v
- name: npm Install
run: npm install
- name: Setup Chomp
uses: guybedford/chomp-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compile to Wasm & Test Wasm
env:
WASI_PATH: './wasi-sdk-${{ env.WASI_VERSION_FULL }}'
EMSDK_PATH: './emsdk'
EMSCRIPTEN_BIN: './emsdk/fastcomp/emscripten/emcc'
run: chomp test
- name: Footprint
run: chomp footprint
- name: Benchmark Wasm
run: chomp bench