ci(js): add Bun and Deno to JS CI matrix with runtime-compat tests #427
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
| # JavaScript/TypeScript CI — builds NAPI-RS bindings and runs tests | |
| # Triggered on PRs and pushes to main when JS-related files change. | |
| name: JS | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "crates/bashkit-js/**" | |
| - "crates/bashkit/src/**" | |
| - "examples/*.mjs" | |
| - "examples/package.json" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".github/workflows/js.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "crates/bashkit-js/**" | |
| - "crates/bashkit/src/**" | |
| - "examples/*.mjs" | |
| - "examples/package.json" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".github/workflows/js.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }} | |
| jobs: | |
| build-and-test: | |
| name: ${{ matrix.runtime }} ${{ matrix.version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Node.js versions | |
| - runtime: node | |
| version: "20" | |
| run: "node" | |
| pkg: "npm" | |
| - runtime: node | |
| version: "22" | |
| run: "node" | |
| pkg: "npm" | |
| - runtime: node | |
| version: "24" | |
| run: "node" | |
| pkg: "npm" | |
| - runtime: node | |
| version: "latest" | |
| run: "node" | |
| pkg: "npm" | |
| # Bun | |
| - runtime: bun | |
| version: "latest" | |
| run: "bun" | |
| pkg: "bun" | |
| - runtime: bun | |
| version: "canary" | |
| run: "bun" | |
| pkg: "bun" | |
| # Deno | |
| - runtime: deno | |
| version: "2.x" | |
| run: "deno run -A" | |
| pkg: "npm" | |
| - runtime: deno | |
| version: "canary" | |
| run: "deno run -A" | |
| pkg: "npm" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Setup Node.js | |
| if: matrix.runtime == 'node' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.version }} | |
| - name: Setup Node.js (for napi build) | |
| if: matrix.runtime != 'node' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Setup Bun | |
| if: matrix.runtime == 'bun' | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ matrix.version }} | |
| - name: Setup Deno | |
| if: matrix.runtime == 'deno' | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: ${{ matrix.version }} | |
| - name: Install dependencies | |
| run: ${{ matrix.pkg }} install | |
| working-directory: crates/bashkit-js | |
| - name: Build native binding | |
| run: ${{ matrix.pkg }} run build | |
| working-directory: crates/bashkit-js | |
| - name: Run tests | |
| run: ${{ matrix.pkg }} test | |
| working-directory: crates/bashkit-js | |
| - name: Install example dependencies and link local build | |
| working-directory: examples | |
| run: | | |
| ${{ matrix.pkg }} install | |
| rm -rf node_modules/@everruns/bashkit | |
| mkdir -p node_modules/@everruns | |
| ln -s ${{ github.workspace }}/crates/bashkit-js node_modules/@everruns/bashkit | |
| - name: Run examples (self-contained) | |
| working-directory: examples | |
| run: | | |
| ${{ matrix.run }} bash_basics.mjs | |
| ${{ matrix.run }} data_pipeline.mjs | |
| ${{ matrix.run }} llm_tool.mjs | |
| ${{ matrix.run }} langchain_integration.mjs | |
| - name: Install Doppler CLI | |
| if: env.DOPPLER_TOKEN != '' | |
| uses: dopplerhq/cli-action@v4 | |
| - name: Run AI examples | |
| if: env.DOPPLER_TOKEN != '' | |
| working-directory: examples | |
| run: | | |
| doppler run -- ${{ matrix.run }} openai_tool.mjs | |
| doppler run -- ${{ matrix.run }} vercel_ai_tool.mjs | |
| doppler run -- ${{ matrix.run }} langchain_agent.mjs | |
| # Gate job for branch protection | |
| js-check: | |
| name: JS Check | |
| if: always() | |
| needs: [build-and-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all jobs passed | |
| run: | | |
| if [[ "${{ needs.build-and-test.result }}" != "success" ]]; then | |
| echo "JS build/test failed" | |
| exit 1 | |
| fi |