Add ggsql WebAssembly library #5
Workflow file for this run
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: wasm.yaml | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Increase disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| sudo docker builder prune -a | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install tree-sitter-cli | |
| run: npm install -g tree-sitter-cli | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install LLVM | |
| run: sudo apt-get install -y llvm | |
| - name: Caching | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ${{ runner.os }}-build | |
| cache-on-failure: true | |
| - name: Install wasm-opt | |
| run: cargo install wasm-opt | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build WASM package | |
| working-directory: ggsql-wasm | |
| run: wasm-pack build --target web --profile wasm --no-opt | |
| - name: Optimise WASM binary | |
| working-directory: ggsql-wasm | |
| run: wasm-opt pkg/ggsql_wasm_bg.wasm -o pkg/ggsql_wasm_bg.wasm -Oz --all-features |