-
Notifications
You must be signed in to change notification settings - Fork 35
87 lines (77 loc) · 2.56 KB
/
main.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
85
86
87
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# Install OpenVINO
- name: Install OpenVINO
uses: abrown/install-openvino-action@v8
- name: Build Wasmtime + wasi-nn
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
git clone https://github.com/bytecodealliance/wasmtime --branch v16.0.0 --depth 1 --recursive
cd wasmtime
OPENVINO_INSTALL_DIR=/opt/intel/openvino cargo build -p wasmtime-cli --features wasi-nn --release
sudo ln -s $(realpath target/release/wasmtime) /usr/local/bin/wasmtime
# Runs a single command using the runners shell
- name: Build and run Rust example
run: |
echo Building and running the Rust Wasi-NN example
./build.sh rust
# Runs a set of commands using the runners shell
- name: Build and run AssemblyScript example
run: |
echo Building and running the Rust Wasi-NN example
./build.sh as
# Test we can publish to NPM
- name: Publish NPM dryrun
run: |
echo Publish NPM dryrun
cd assemblyscript
npm publish --dry-run
rust:
name: Build and test the Rust bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-wasi
- name: Run tests on native architecture
working-directory: rust
run: cargo test
- name: Build on wasm32-wasi
working-directory: rust
run: cargo build --target=wasm32-wasi
- name: Check dry-run publish to crates.io
working-directory: rust
run: cargo publish --dry-run
check_bindings:
name: Regenerate Rust bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Regenerate bindings
run: rust/scripts/regenerate-bindings-from-witx.sh
- name: Verify no changes
run: git diff --ignore-submodules --no-ext-diff --name-only --exit-code
image2tensor:
name: Build the image2tensor crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-wasi
- name: Build for wasm32-wasi
working-directory: image2tensor
run: cargo build --target=wasm32-wasi
- name: Check dry-run publish to crates.io
working-directory: image2tensor
run: cargo publish --dry-run