fix tiny skia wasm #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |