-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 1.96 KB
/
Copy pathwasm.yml
File metadata and controls
68 lines (58 loc) · 1.96 KB
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
name: Build and Deploy WASM app
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Install Binaryen (wasm-opt)
run: |
BINARYEN_VERSION=$(curl -s https://api.github.com/repos/WebAssembly/binaryen/releases/latest | jq -r .tag_name)
curl -L -O https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN_VERSION}/binaryen-${BINARYEN_VERSION}-x86_64-linux.tar.gz
tar -xzf binaryen-${BINARYEN_VERSION}-x86_64-linux.tar.gz
echo "$(pwd)/binaryen-${BINARYEN_VERSION}/bin" >> $GITHUB_PATH
- name: depends
run: |
cd ..
git clone https://github.com/bgkillas/rupl
git clone https://github.com/bgkillas/kalc-lib
cd kalc-plot
- name: fmt
run: cargo fmt --check
- name: lint
run: |
cargo clippy --no-default-features --features "tiny-skia,wasm" --target wasm32-unknown-unknown -- -D clippy::all
cargo clippy --no-default-features --features "wasm-draw" --target wasm32-unknown-unknown -- -D clippy::all
- name: Build WASM app
run: |
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cd www
bash start.sh
- name: Copy site files to output
run: |
mkdir dist
cp -r www/* dist/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4