-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (44 loc) · 1.37 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
name: rust-wasm-study
on: [push]
env:
RUSTUP_TOOLCHAIN: "1.79.0"
RUSTUP_HOME: "./rust/rustup"
CARGO_HOME: "./rust/cargo"
jobs:
build-rust-wasm-study:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Rust
id: cache-rust
uses: actions/cache@v4
with:
path: rust
key: ${{ runner.os }}-rustup-${{env.RUSTUP_TOOLCHAIN}}
- name: Install rust
if: steps.cache-rust.outputs.cache-hit != 'true'
run: |
mkdir -p $RUSTUP_HOME
mkdir -p $CARGO_HOME
curl https://sh.rustup.rs -sSf | sh -s -- -y
rustup install $RUSTUP_TOOLCHAIN
rustup target add wasm32-wasi --toolchain $RUSTUP_TOOLCHAIN
rustup target add wasm32-unknown-unknown --toolchain $RUSTUP_TOOLCHAIN
- name: Configure Rust and display version
run: |
echo "PATH=$(dirname $(rustup which cargo)):$PATH" >> $GITHUB_ENV
rustc --version
cargo --version
- name: Build Rust Wasm Study
run: |
cd wasm-module1
cargo build --release --target wasm32-wasi
cd ..
cd wasm-module2
cargo build --release --target wasm32-wasi
cd ..
cd wasm-app
cargo build --release