refactor: restructure #16
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Read zig version | |
| id: zig-version | |
| run: echo "version=$(grep -oP 'minimum_zig_version\s*=\s*"\K[^"]+' build.zig.zon)" >> "$GITHUB_OUTPUT" | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: ${{ steps.zig-version.outputs.version }} | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip1 | |
| - name: Install cargo-zigbuild | |
| run: cargo install cargo-zigbuild | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| - name: Build wasm | |
| run: zig build wasi | |
| - name: Inline wasm | |
| run: node build.ts | |
| - name: Upload lib | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: lib | |
| path: lib/ | |
| test: | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download lib | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: lib | |
| path: lib/ | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| - name: Test (Node) | |
| run: node test.ts | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Test (Bun) | |
| run: bun test.ts | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Test (Deno) | |
| run: deno run --allow-read --allow-write --allow-env test.ts |