Skip to content
Latchkey

Test JS SDK workflow (e2b-dev/code-interpreter)

The Test JS SDK workflow from e2b-dev/code-interpreter, explained and optimized by Latchkey.

B

CI health: B - good

Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: e2b-dev/code-interpreter.github/workflows/js_tests.ymlLicense Apache-2.0View source

What it does

This is the Test JS SDK workflow from the e2b-dev/code-interpreter repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Test JS SDK

on:
  workflow_call:
    secrets:
      E2B_API_KEY:
        required: true
    inputs:
      E2B_DOMAIN:
        required: false
        type: string
      E2B_TESTS_TEMPLATE:
        required: false
        type: string

permissions:
  contents: read

jobs:
  test:
    defaults:
      run:
        working-directory: ./js
    name: JS SDK - Build and test
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install pnpm
        uses: pnpm/action-setup@v3
        id: pnpm-install
        with:
          version: 9.5

      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: "20.x"
          registry-url: "https://registry.npmjs.org"
          cache: pnpm
          cache-dependency-path: pnpm-lock.yaml

      - name: Configure pnpm
        run: |
          pnpm config set auto-install-peers true
          pnpm config set exclude-links-from-lockfile true

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

      - name: Test build
        run: pnpm build

      - name: Run Node tests
        run: pnpm test
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}

      - name: Install Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: 1.3.14

      - name: Run Bun tests
        run: pnpm test:bun
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}

      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Run Deno tests
        run: pnpm test:deno
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Test JS SDK
 
on:
  workflow_call:
    secrets:
      E2B_API_KEY:
        required: true
    inputs:
      E2B_DOMAIN:
        required: false
        type: string
      E2B_TESTS_TEMPLATE:
        required: false
        type: string
 
permissions:
  contents: read
 
jobs:
  test:
    timeout-minutes: 30
    defaults:
      run:
        working-directory: ./js
    name: JS SDK - Build and test
    runs-on: latchkey-small
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
 
      - name: Install pnpm
        uses: pnpm/action-setup@v3
        id: pnpm-install
        with:
          version: 9.5
 
      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: "20.x"
          registry-url: "https://registry.npmjs.org"
          cache: pnpm
          cache-dependency-path: pnpm-lock.yaml
 
      - name: Configure pnpm
        run: |
          pnpm config set auto-install-peers true
          pnpm config set exclude-links-from-lockfile true
 
      - name: Install dependencies
        run: pnpm install --frozen-lockfile
 
      - name: Test build
        run: pnpm build
 
      - name: Run Node tests
        run: pnpm test
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
 
      - name: Install Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: 1.3.14
 
      - name: Run Bun tests
        run: pnpm test:bun
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
 
      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
 
      - name: Run Deno tests
        run: pnpm test:deno
        env:
          E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
          E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
          E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
 

What changed

3 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow