-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.15 KB
/
wasm.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
name: wasm
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: wasm
strategy:
matrix:
build: [linux]
include:
- build: linux
os: ubuntu-lastest
rust: nightly
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-test
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Build and Test
shell: bash
run: |
export RUSTFLAGS="-Awarnings"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
rustup target add wasm32-unknown-unknown
export PATH="$PATH:/home/runner/.cargo/bin/"
cargo install wasm-pack
bash build_web.zsh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www