refactor: add environment-specific entry points for WASM module loading #272
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: Test | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize] | |
| push: | |
| branches: | |
| - "*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_TERM_COLOR: "always" | |
| DIFF: 0 | |
| RUST_LOG: "off" | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: dprint,taplo,just | |
| - run: just check | |
| - run: just test-rust | |
| audit: | |
| name: Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-audit | |
| - run: cargo audit | |
| wasm-build: | |
| name: Wasm build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: wasm-pack,just | |
| - name: Build wasm | |
| run: just build | |
| - run: npm pack | |
| working-directory: pkg | |
| - name: Upload | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: build | |
| path: pkg | |
| test-wasm: | |
| name: Run ${{ matrix.runtime }} tests on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: wasm-build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runtime: [node, deno, bun] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: build | |
| path: pkg/ | |
| - uses: actions/setup-node@v6 | |
| if: matrix.runtime == 'node' | |
| with: | |
| node-version-file: ".node-version" | |
| - uses: denoland/setup-deno@v2 | |
| if: matrix.runtime == 'deno' | |
| with: | |
| deno-version: 2.x | |
| - uses: oven-sh/setup-bun@v2 | |
| if: matrix.runtime == 'bun' | |
| name: Install bun | |
| - run: just test-${{ matrix.runtime }} |