forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (77 loc) · 2.3 KB
/
build_for_riscv.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
71
72
73
74
75
76
77
78
79
80
81
name: Build and Test WasmEdge on riscv64 arch
concurrency:
group: build-riscv64-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches:
- master
paths:
- ".github/workflows/build_for_riscv.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
- "cmake/**"
pull_request:
branches:
- master
- 'proposal/**'
paths:
- ".github/workflows/build_for_riscv.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
- "cmake/**"
jobs:
# TODO: Refactor `lint` with `on.workflow_run`
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
lint:
uses: ./.github/workflows/reusable-call-linter.yml
build_riscv64:
name: RISC-V64
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- uses: uraimo/run-on-arch-action@v2
name: Build WasmEdge
with:
base_image: riscv64/ubuntu
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/workplace"
shell: /bin/sh
install: |
apt-get update -q -y
apt-get install -q -y git cmake g++ dpkg
apt-get install -q -y software-properties-common
apt-get install -q -y llvm-12-dev liblld-12-dev
apt-get install -q -y wabt # For generating wasm
run: |
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install
wasmedge -v
wasmedgec -v
wasmedge compile -h
wasmedge run -h
cd ../examples/wasm
wat2wasm fibonacci.wat -o fibonacci.wasm
wasmedgec fibonacci.wasm fibonacci_aot_c.wasm
wasmedge --reactor fibonacci_aot_c.wasm fib 30
wasmedge run --reactor fibonacci_aot_c.wasm fib 30
wasmedge compile fibonacci.wasm fibonacci_aot_compile.wasm
wasmedge --reactor fibonacci_aot_compile.wasm fib 30
wasmedge run --reactor fibonacci_aot_compile.wasm fib 30