move surface/pixmap reallocation optimization to rupl #13
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=version_123 | |
| 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,rayon" --target wasm32-unknown-unknown -- -D clippy::all | |
| - name: Build WASM app | |
| run: | | |
| wasm-pack build --out-dir www/pkg --target web --release --no-default-features --features "tiny-skia,wasm,rayon" | |
| cd www | |
| wasm-opt -O3 --enable-bulk-memory --enable-nontrapping-float-to-int -o pkg/kalc_plot_bg.wasm pkg/kalc_plot_bg.wasm | |
| cd .. | |
| - 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 |