From df8c2838f22b5c62d0cd310dd2af82ea9c941958 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 12 Mar 2026 12:00:02 +0100 Subject: [PATCH 1/4] chore: Simplify github workflows and allow for required jobs --- .github/workflows/{js.yaml => checks.yaml} | 326 ++++++++++++++---- .github/workflows/e2e.yaml | 43 --- .github/workflows/integration-tests.yaml | 89 +++-- .github/workflows/lint.yaml | 71 ---- .github/workflows/otel-js-test.yaml | 40 --- .github/workflows/platform-tests.yaml | 47 +++ .../templates-nunjucks-build-test.yaml | 44 --- .github/workflows/temporal-js-build-test.yaml | 44 --- .github/workflows/test-zod-versions.yaml | 86 ----- Makefile | 17 +- integrations/otel-js/CLAUDE.md | 45 +-- js/Makefile | 19 +- js/smoke/README.md | 8 +- 13 files changed, 391 insertions(+), 488 deletions(-) rename .github/workflows/{js.yaml => checks.yaml} (53%) delete mode 100644 .github/workflows/e2e.yaml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/otel-js-test.yaml create mode 100644 .github/workflows/platform-tests.yaml delete mode 100644 .github/workflows/templates-nunjucks-build-test.yaml delete mode 100644 .github/workflows/temporal-js-build-test.yaml delete mode 100644 .github/workflows/test-zod-versions.yaml diff --git a/.github/workflows/js.yaml b/.github/workflows/checks.yaml similarity index 53% rename from .github/workflows/js.yaml rename to .github/workflows/checks.yaml index c97e59ece..bbb38d622 100644 --- a/.github/workflows/js.yaml +++ b/.github/workflows/checks.yaml @@ -1,16 +1,7 @@ -name: js +name: checks on: pull_request: - paths: - - "js/**" - - "integrations/otel-js/**" - - "integrations/temporal-js/**" - - ".github/workflows/js.yaml" - - ".github/workflows/otel-js-test.yaml" - - ".github/workflows/temporal-js-build-test.yaml" - - "pnpm-lock.yaml" - - "pnpm-workspace.yaml" push: branches: [main] @@ -19,38 +10,91 @@ permissions: actions: write jobs: - build: + formatting: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Check formatting + run: pnpm run formatting + + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Lint + run: pnpm run lint + + check-typings: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Check typings + run: pnpm run check:typings + + dead-code: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Check dead code + run: pnpm run knip + + ensure-pinned-actions: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Ensure SHA pinned actions + uses: zgosalvez/github-actions-ensure-sha-pinned-actions@70c4af2ed5282c51ba40566d026d6647852ffa3e # v5.0.1 + + js-build: runs-on: ${{ matrix.os }} timeout-minutes: 30 - strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] node-version: [20, 22] - - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY}} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY}} - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}} - outputs: artifact-name: ${{ steps.artifact.outputs.name }} - steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ matrix.node-version }} registry-url: "https://registry.npmjs.org" - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - - name: "verify ci" + - name: Verify checks shell: bash run: | - make js-verify-ci - + make js-verify-checks - name: Determine artifact name id: artifact env: @@ -66,7 +110,6 @@ jobs: mkdir -p artifacts PACKED_TARBALL=$(npm pack --pack-destination artifacts) echo "packed_tarball=$PACKED_TARBALL" >> "$GITHUB_OUTPUT" - - name: Pack @braintrust/browser id: prepare_browser_artifact working-directory: integrations/browser-js @@ -74,12 +117,10 @@ jobs: run: | PACKED_BROWSER_TARBALL=$(npm pack --pack-destination ../../js/artifacts) echo "packed_browser_tarball=$PACKED_BROWSER_TARBALL" >> "$GITHUB_OUTPUT" - - name: Build and pack @braintrust/otel id: prepare_otel_artifact shell: bash run: | - # Install the built braintrust package in otel-js to satisfy peer dependency BRAINTRUST_TARBALL=$(ls js/artifacts/braintrust-*.tgz | head -n 1) if [ -z "$BRAINTRUST_TARBALL" ]; then echo "Error: braintrust tarball not found" @@ -87,8 +128,6 @@ jobs: fi echo "Using braintrust tarball: $BRAINTRUST_TARBALL" - # Install braintrust and OpenTelemetry peer dependencies in otel-js directory for build - # Use pnpm to match the workspace, with no-save flags to avoid modifying lockfile cd integrations/otel-js if ! npm_config_save=false npm_config_lockfile=false pnpm add \ file:../../$BRAINTRUST_TARBALL \ @@ -100,13 +139,10 @@ jobs: exit 1 fi - # Build the otel package pnpm run build - # Pack the otel package PACKED_OTEL_TARBALL=$(npm pack --pack-destination ../../js/artifacts) echo "packed_otel_tarball=$PACKED_OTEL_TARBALL" >> "$GITHUB_OUTPUT" - - name: Build and pack @braintrust/templates-nunjucks id: prepare_templates_nunjucks_artifact shell: bash @@ -115,7 +151,6 @@ jobs: pnpm run build PACKED_NUNJUCKS_TARBALL=$(npm pack --pack-destination ../../js/artifacts) echo "packed_nunjucks_tarball=$PACKED_NUNJUCKS_TARBALL" >> "$GITHUB_OUTPUT" - - name: List artifacts before upload shell: bash run: | @@ -124,7 +159,6 @@ jobs: echo "Otel tarball: ${{ steps.prepare_otel_artifact.outputs.packed_otel_tarball }}" echo "Templates-nunjucks tarball: ${{ steps.prepare_templates_nunjucks_artifact.outputs.packed_nunjucks_tarball }}" ls -la js/artifacts/ - - name: Upload build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: @@ -136,26 +170,22 @@ jobs: js/artifacts/${{ steps.prepare_templates_nunjucks_artifact.outputs.packed_nunjucks_tarball }} retention-days: 1 - api-compatibility: + js-api-compatibility: runs-on: ubuntu-latest timeout-minutes: 20 - # Run in parallel with build job strategy: fail-fast: false matrix: node-version: [20] - steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: - fetch-depth: 0 # Fetch full history to access main branch for baseline - + fetch-depth: 0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ matrix.node-version }} registry-url: "https://registry.npmjs.org" - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Get published braintrust version for cache key id: published-version shell: bash @@ -163,7 +193,6 @@ jobs: PUBLISHED_VERSION=$(npm view braintrust version 2>/dev/null || echo "none") echo "version=$PUBLISHED_VERSION" >> "$GITHUB_OUTPUT" echo "Published version: $PUBLISHED_VERSION" - - name: Cache API compatibility test tarball uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: @@ -172,51 +201,40 @@ jobs: restore-keys: | braintrust-tarball-${{ steps.published-version.outputs.version }}- braintrust-tarball- - - name: Build baseline from main branch for API compatibility shell: bash run: | - # Save current state CURRENT_REF=$(git rev-parse HEAD) BASELINE_DIR="$HOME/braintrust-baseline" mkdir -p "$BASELINE_DIR" - # Checkout main and build echo "Building baseline from main branch..." git checkout origin/main || { echo "Could not checkout main"; exit 0; } - # Install and build main pnpm install --frozen-lockfile || { echo "Baseline install failed"; git checkout "$CURRENT_REF"; exit 0; } pnpm run build || { echo "Baseline build failed"; git checkout "$CURRENT_REF"; exit 0; } - # Copy built files to baseline directory mkdir -p "$BASELINE_DIR/js/dev" "$BASELINE_DIR/js/util" cp -R js/dist "$BASELINE_DIR/js/" cp -R js/dev/dist "$BASELINE_DIR/js/dev/" cp -R js/util/dist "$BASELINE_DIR/js/util/" echo "Copied js/dist, js/dev/dist, and js/util/dist to baseline" - # Return to original commit git checkout "$CURRENT_REF" - # Set environment variable for test to find baseline - echo "BASELINE_DIR=$BASELINE_DIR" >> $GITHUB_ENV + echo "BASELINE_DIR=$BASELINE_DIR" >> "$GITHUB_ENV" echo "Baseline created at $BASELINE_DIR" - - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Build current branch run: pnpm run build - - name: Run API compatibility test env: BASELINE_DIR: ${{ env.BASELINE_DIR }} run: | cd js && pnpm test:api-compat - # Smoke v2: Auto-discovery of scenarios - smoke-discover: + js-smoke-discover: runs-on: ubuntu-latest timeout-minutes: 5 outputs: @@ -230,49 +248,42 @@ jobs: run: | echo "Discovering local and integration scenarios..." SCRIPTDIR="../../integrations" - # Local scenarios (under js/smoke/scenarios): emit their directory names LOCAL=$(find scenarios -mindepth 1 -maxdepth 1 -type d -exec test -f {}/Makefile \; -print | sed 's|scenarios/||' | tr '\n' ' ') - # Integration scenarios: emit as integration/name INTEGRATIONS=$(find "$SCRIPTDIR" -type f -path '*/smoke/scenarios/*/Makefile' 2>/dev/null | sed "s|^$SCRIPTDIR/||" | sed 's|/Makefile$||' | sed 's|/smoke/scenarios/|/|' | tr '\n' ' ') ALL="${LOCAL} ${INTEGRATIONS}" - # Convert space-separated list to JSON array SCENARIOS=$(printf "%s\n" $ALL | jq -R -s -c 'split("\n") | map(select(length>0))') echo "scenarios=$SCENARIOS" >> "$GITHUB_OUTPUT" echo "Discovered scenarios: $SCENARIOS" - smoke-test: - needs: [build, smoke-discover] + js-smoke-test: + needs: [js-build, js-smoke-discover] runs-on: ubuntu-latest timeout-minutes: 15 - strategy: fail-fast: false matrix: - scenario: ${{ fromJson(needs.smoke-discover.outputs.scenarios) }} - + scenario: ${{ fromJson(needs.js-smoke-discover.outputs.scenarios) }} steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Setup mise uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4 with: working_directory: js/smoke - + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 20 - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Download build artifact (node 20) uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - name: ${{ needs.build.outputs.artifact-name }}-20-dist + name: ${{ needs.js-build.outputs.artifact-name }}-20-dist path: js/artifacts run-id: ${{ github.run_id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - + github-token: ${{ github.token }} - name: Prepare artifacts at well-known paths working-directory: js/artifacts shell: bash run: | - # Copy braintrust tarball to well-known path for f in braintrust-[0-9]*.tgz; do if [ -f "$f" ]; then cp "$f" braintrust-latest.tgz @@ -281,7 +292,6 @@ jobs: fi done - # Copy browser tarball to well-known path for f in braintrust-browser-[0-9]*.tgz; do if [ -f "$f" ]; then cp "$f" braintrust-browser-latest.tgz @@ -290,7 +300,6 @@ jobs: fi done - # Copy otel tarball to well-known path for f in braintrust-otel-[0-9]*.tgz; do if [ -f "$f" ]; then cp "$f" braintrust-otel-latest.tgz @@ -299,7 +308,6 @@ jobs: fi done - # Copy templates-nunjucks-js tarball to well-known path for f in braintrust-templates-nunjucks-js-[0-9]*.tgz; do if [ -f "$f" ]; then cp "$f" braintrust-templates-nunjucks-js-latest.tgz @@ -307,19 +315,16 @@ jobs: break fi done - - name: Build shared test package (once for all scenarios) working-directory: js/smoke/shared shell: bash run: | npm ci npm run build - - name: Run scenario ${{ matrix.scenario }} working-directory: js/smoke shell: bash env: - BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} CI: true BRAINTRUST_TAR: ../artifacts/braintrust-latest.tgz BRAINTRUST_BROWSER_TAR: ../artifacts/braintrust-browser-latest.tgz @@ -328,3 +333,174 @@ jobs: SMOKE_V2_SHARED_DIST: shared/dist run: | make test ${{ matrix.scenario }} + + temporal-js: + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + node-version: [20, 22] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Build braintrust + working-directory: js + run: pnpm run build + - name: Build @braintrust/temporal + working-directory: integrations/temporal-js + run: pnpm run build + - name: Run @braintrust/temporal tests + working-directory: integrations/temporal-js + run: pnpm run test + + templates-nunjucks-js: + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + node-version: [20, 22] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Build braintrust + working-directory: js + run: pnpm run build + - name: Build @braintrust/templates-nunjucks-js + working-directory: integrations/templates-nunjucks + run: pnpm run build + - name: Run @braintrust/templates-nunjucks-js tests + working-directory: integrations/templates-nunjucks + run: pnpm run test + + otel-js: + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + node-version: [20, 22] + test-dir: [otel-v1, otel-v2] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - name: Build Docker image for ${{ matrix.test-dir }} + shell: bash + run: | + docker build -f integrations/otel-js/Dockerfile.test \ + --build-arg NODE_VERSION=${{ matrix.node-version }} \ + --build-arg TEST_DIR=${{ matrix.test-dir }} \ + -t otel-js-test-${{ matrix.test-dir }}-node${{ matrix.node-version }} . + - name: Run tests for ${{ matrix.test-dir }} + shell: bash + run: | + docker run --rm otel-js-test-${{ matrix.test-dir }}-node${{ matrix.node-version }} + + js-zod-versions: + name: JS Zod Versions (${{ matrix.zod-version }}) + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + zod-version: ["3.25.34", "4.2.1"] + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 1 + - name: Setup pnpm + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: "22" + cache: "pnpm" + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Setup Zod version + working-directory: ./js + run: | + pnpm add -D zod@${{ matrix.zod-version }} + - name: Run hermetic JS tests + working-directory: ./js + shell: bash + run: | + make test-checks + - name: Run zod v3 tests + if: matrix.zod-version == '3.25.34' + working-directory: ./js + run: | + pnpm test:zod-v3 + - name: Run zod v4 tests + if: matrix.zod-version == '4.2.1' + working-directory: ./js + run: | + pnpm test:zod-v4 + + checks-passed: + name: checks-passed + needs: + - formatting + - lint + - check-typings + - dead-code + - ensure-pinned-actions + - js-build + - js-api-compatibility + - js-smoke-discover + - js-smoke-test + - temporal-js + - templates-nunjucks-js + - otel-js + - js-zod-versions + runs-on: ubuntu-latest + timeout-minutes: 5 + if: always() + steps: + - name: Verify all required checks passed + run: | + FAILED=0 + + check_result() { + local job_name="$1" + local job_result="$2" + + if [ "$job_result" != "success" ]; then + echo "Job '$job_name' finished with result: $job_result" + FAILED=1 + fi + } + + check_result "formatting" "${{ needs.formatting.result }}" + check_result "lint" "${{ needs.lint.result }}" + check_result "check-typings" "${{ needs.check-typings.result }}" + check_result "dead-code" "${{ needs.dead-code.result }}" + check_result "ensure-pinned-actions" "${{ needs.ensure-pinned-actions.result }}" + check_result "js-build" "${{ needs.js-build.result }}" + check_result "js-api-compatibility" "${{ needs.js-api-compatibility.result }}" + check_result "js-smoke-discover" "${{ needs.js-smoke-discover.result }}" + check_result "js-smoke-test" "${{ needs.js-smoke-test.result }}" + check_result "temporal-js" "${{ needs.temporal-js.result }}" + check_result "templates-nunjucks-js" "${{ needs.templates-nunjucks-js.result }}" + check_result "otel-js" "${{ needs.otel-js.result }}" + check_result "js-zod-versions" "${{ needs.js-zod-versions.result }}" + + if [ "$FAILED" -ne 0 ]; then + echo "One or more required checks failed" + exit 1 + fi + + echo "All required checks passed" diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml deleted file mode 100644 index 97f660039..000000000 --- a/.github/workflows/e2e.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: e2e - -on: - pull_request: - paths: - - "e2e/**" - - "js/**" - - ".github/workflows/e2e.yaml" - - "package.json" - - "pnpm-lock.yaml" - - "pnpm-workspace.yaml" - - "turbo.json" - push: - branches: [main] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - timeout-minutes: 20 - - env: - BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 20 - - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Run e2e tests - run: pnpm test:e2e diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 23587ba5b..a69115695 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -2,46 +2,61 @@ name: integration-tests on: pull_request: - types: [opened, synchronize, reopened, labeled] + paths: + - "js/**" + - "e2e/**" + - ".github/workflows/integration-tests.yaml" + - "package.json" + - "pnpm-lock.yaml" + - "pnpm-workspace.yaml" + - "turbo.json" + - "Makefile" + push: + branches: [main] -jobs: - open-pr: - if: ${{ contains(github.event.pull_request.labels.*.name, 'run-integration-tests') }} - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - contents: write - pull-requests: write +permissions: + contents: read +jobs: + js-provider-tests: + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + node-version: [20, 22] + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} steps: - - name: Checkout parent repository - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - repository: braintrustdata/braintrust - path: braintrust - token: ${{ secrets.CROSS_REPO_TOKEN }} - fetch-depth: 0 - - - name: Configure Git in parent repository + node-version: ${{ matrix.node-version }} + registry-url: "https://registry.npmjs.org" + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Run provider-backed JS tests + shell: bash run: | - cd braintrust - git config user.name "GitHub Actions Bot" - git config user.email "actions@github.com" + make js-test-external - - name: Initialize and update SDK submodule - run: | - cd braintrust - git submodule init - git submodule update --init --recursive - cd sdk - git remote set-url origin https://github.com/braintrustdata/braintrust-sdk-javascript.git - git fetch origin - git checkout ${{ github.event.pull_request.head.sha }} - - - name: Create integration test PR - run: ./braintrust/sdk/scripts/create-integration-test-pr.sh - env: - GH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - COMMIT_HASH: ${{ github.event.pull_request.head.sha }} - PARENT_REPO_PATH: braintrust + e2e: + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 20 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Run e2e tests + run: pnpm test:e2e diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 999767e7d..000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: quality - -on: - pull_request: - push: - branches: [main] - -jobs: - formatting: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 22 - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Check formatting - run: pnpm run formatting - - lint: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 22 - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Lint - run: pnpm run lint - - check-typings: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 22 - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Check typings - run: pnpm run check:typings - - dead-code: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 22 - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Check dead code - run: pnpm run knip - - ensure-pinned-actions: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Ensure SHA pinned actions - uses: zgosalvez/github-actions-ensure-sha-pinned-actions@70c4af2ed5282c51ba40566d026d6647852ffa3e # v5.0.1 diff --git a/.github/workflows/otel-js-test.yaml b/.github/workflows/otel-js-test.yaml deleted file mode 100644 index 0d097b5a7..000000000 --- a/.github/workflows/otel-js-test.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: otel-js - -on: - pull_request: - paths: - - "integrations/otel-js/**" - - "js/**" - - ".github/workflows/otel-js-test.yaml" - push: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - timeout-minutes: 20 - - strategy: - fail-fast: false - matrix: - node-version: [20, 22] - test-dir: [otel-v1, otel-v2] - - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - - - name: Build Docker image for ${{ matrix.test-dir }} - shell: bash - run: | - docker build -f integrations/otel-js/Dockerfile.test \ - --build-arg NODE_VERSION=${{ matrix.node-version }} \ - --build-arg TEST_DIR=${{ matrix.test-dir }} \ - -t otel-js-test-${{ matrix.test-dir }}-node${{ matrix.node-version }} . - - - name: Run tests for ${{ matrix.test-dir }} - shell: bash - run: | - docker run --rm otel-js-test-${{ matrix.test-dir }}-node${{ matrix.node-version }} diff --git a/.github/workflows/platform-tests.yaml b/.github/workflows/platform-tests.yaml new file mode 100644 index 000000000..6d5d69c03 --- /dev/null +++ b/.github/workflows/platform-tests.yaml @@ -0,0 +1,47 @@ +name: platform-tests + +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + +jobs: + open-pr: + if: ${{ contains(github.event.pull_request.labels.*.name, 'run-integration-tests') }} + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout parent repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + repository: braintrustdata/braintrust + path: braintrust + token: ${{ secrets.CROSS_REPO_TOKEN }} + fetch-depth: 0 + + - name: Configure Git in parent repository + run: | + cd braintrust + git config user.name "GitHub Actions Bot" + git config user.email "actions@github.com" + + - name: Initialize and update SDK submodule + run: | + cd braintrust + git submodule init + git submodule update --init --recursive + cd sdk + git remote set-url origin https://github.com/braintrustdata/braintrust-sdk-javascript.git + git fetch origin + git checkout ${{ github.event.pull_request.head.sha }} + + - name: Create integration test PR + run: ./braintrust/sdk/scripts/create-integration-test-pr.sh + env: + GH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + COMMIT_HASH: ${{ github.event.pull_request.head.sha }} + PARENT_REPO_PATH: braintrust diff --git a/.github/workflows/templates-nunjucks-build-test.yaml b/.github/workflows/templates-nunjucks-build-test.yaml deleted file mode 100644 index a543e0497..000000000 --- a/.github/workflows/templates-nunjucks-build-test.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: templates-nunjucks-js - -on: - pull_request: - paths: - - "integrations/templates-nunjucks/**" - - "js/**" - - ".github/workflows/templates-nunjucks-build-test.yaml" - push: - branches: [main] - -jobs: - build-and-test: - runs-on: ubuntu-latest - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - node-version: [20, 22] - - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: ${{ matrix.node-version }} - - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build braintrust - working-directory: js - run: pnpm run build - - - name: Build @braintrust/templates-nunjucks-js - working-directory: integrations/templates-nunjucks - run: pnpm run build - - - name: Run @braintrust/templates-nunjucks-js tests - working-directory: integrations/templates-nunjucks - run: pnpm run test diff --git a/.github/workflows/temporal-js-build-test.yaml b/.github/workflows/temporal-js-build-test.yaml deleted file mode 100644 index 87783067e..000000000 --- a/.github/workflows/temporal-js-build-test.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: temporal-js - -on: - pull_request: - paths: - - "integrations/temporal-js/**" - - "js/**" - - ".github/workflows/temporal-js-test.yaml" - push: - branches: [main] - -jobs: - build-and-test: - runs-on: ubuntu-latest - timeout-minutes: 15 - - strategy: - fail-fast: false - matrix: - node-version: [20, 22] - - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: ${{ matrix.node-version }} - - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build braintrust - working-directory: js - run: pnpm run build - - - name: Build @braintrust/temporal - working-directory: integrations/temporal-js - run: pnpm run build - - - name: Run @braintrust/temporal tests - working-directory: integrations/temporal-js - run: pnpm run test diff --git a/.github/workflows/test-zod-versions.yaml b/.github/workflows/test-zod-versions.yaml deleted file mode 100644 index 822c87969..000000000 --- a/.github/workflows/test-zod-versions.yaml +++ /dev/null @@ -1,86 +0,0 @@ -name: Test sdk with multiple zod versions -on: - pull_request: - paths: - - "js/**" - - "pnpm-lock.yaml" - - "pnpm-workspace.yaml" - - ".github/workflows/test-zod-versions.yaml" - push: - branches: - - main - workflow_dispatch: - -permissions: - contents: read - actions: write - -jobs: - test-zod-versions: - name: Test with zod ${{ matrix.zod-version }} - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - zod-version: ["3.25.34", "4.2.1"] - - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY}} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY}} - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}} - - steps: - - name: Checkout repository - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - fetch-depth: 1 - - - name: Setup pnpm - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: "22" - cache: "pnpm" - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Setup Zod version - working-directory: ./js - run: | - pnpm add -D zod@${{ matrix.zod-version }} - - - name: Run regular tests - shell: bash - run: make js-test - - - name: Run zod v3 tests - if: matrix.zod-version == '3.25.34' - working-directory: ./js - run: | - pnpm test:zod-v3 - - - name: Run zod v4 tests - if: matrix.zod-version == '4.2.1' - working-directory: ./js - run: | - pnpm test:zod-v4 - - test-summary: - name: Test Summary - needs: test-zod-versions - runs-on: ubuntu-latest - timeout-minutes: 5 - if: always() - steps: - - name: Check test results - run: | - if [ "${{ needs.test-zod-versions.result }}" != "success" ]; then - echo "❌ Tests failed with one or more Zod versions" - exit 1 - else - echo "✅ All tests passed with both Zod 3.x and 4.x" - fi diff --git a/Makefile b/Makefile index cc49249f7..b45a0bbca 100644 --- a/Makefile +++ b/Makefile @@ -25,21 +25,26 @@ fixup: # # -.PHONY: js-build js-test js-docs js-verify-ci +.PHONY: js-build js-test js-test-checks js-test-external js-docs js-verify-checks js-verify-ci js-build: pnpm install --frozen-lockfile pnpm run build -js-test: js-build - # Run tests only for the JS workspace packages and exclude integration scenario tests - pnpm --filter ./js... run test - cd js && make test +js-test-checks: js-build + cd js && make test-checks + +js-test-external: js-build + cd js && make test-external + +js-test: js-test-checks js-test-external js-docs: js-build cd js && make docs -js-verify-ci: js-docs js-test +js-verify-checks: js-docs js-test-checks + +js-verify-ci: js-verify-checks js-test-external js-test-otel-docker: @echo "Building Docker images for otel-js tests..." diff --git a/integrations/otel-js/CLAUDE.md b/integrations/otel-js/CLAUDE.md index f76220eac..5c83827fd 100644 --- a/integrations/otel-js/CLAUDE.md +++ b/integrations/otel-js/CLAUDE.md @@ -401,29 +401,13 @@ The otel-js package has a **dedicated CI workflow** separate from the main JavaS 3. **Different failure modes**: OTel version conflicts shouldn't block other SDK tests 4. **Clearer test results**: Separate workflow makes it easier to identify OTel-specific issues -### CI Workflow: `.github/workflows/otel-js-test.yaml` +### CI Workflow: `.github/workflows/checks.yaml` -The dedicated workflow simply runs: +The consolidated `checks` workflow contains a dedicated `otel-js` job that: -```bash -make js-test-otel -``` - -This Makefile target handles: - -1. **Installing workspace dependencies** (respects exclusions) -2. **Building braintrust SDK** (required peer dependency) -3. **Building @braintrust/otel package** -4. **Setting up otel-v1 isolated dependencies**: - ```bash - cd otel-v1 && rm -rf node_modules && pnpm add -D vitest - ``` -5. **Setting up otel-v2 isolated dependencies**: - ```bash - cd otel-v2 && rm -rf node_modules && pnpm add -D vitest - ``` -6. **Running otel-v1 tests** (OpenTelemetry 1.x compatibility) -7. **Running otel-v2 tests** (OpenTelemetry 2.x compatibility) +1. **Builds isolated Docker images** for `otel-v1` and `otel-v2` +2. **Runs each image across Node 20 and 22** +3. **Keeps OTel-specific failures scoped to the `otel-js` job** ### Workflow Triggers @@ -432,7 +416,7 @@ The workflow runs on: - **Pull requests** that modify: - `integrations/otel-js/**` - `js/**` (braintrust SDK) - - `.github/workflows/otel-js-test.yaml` + - `.github/workflows/checks.yaml` - **Pushes to main** that modify the same paths ### Matrix Testing @@ -442,24 +426,17 @@ Tests run on: - **Operating systems**: Ubuntu, Windows - **Node versions**: 20, 22 -### Main JS Workflow Exclusion - -The main `js.yaml` workflow explicitly excludes otel-js to prevent conflicts: +### Checks Workflow Placement -```yaml -on: - pull_request: - paths-ignore: - - "integrations/otel-js/**" -``` +OTel coverage now lives inside the consolidated `checks` workflow as its own job rather than in a separate workflow file. ### Makefile Targets **For CI:** ```bash -make js-test # Main SDK tests (otel-js tested separately via paths-ignore) -make js-test-otel # Dedicated otel-js testing with isolation setup +make js-verify-checks # Main hermetic checks workflow entrypoint +make js-test-otel-docker # Local equivalent for the Docker-based otel-js job ``` **For local development:** @@ -490,4 +467,4 @@ docker build -f integrations/otel-js/Dockerfile.test --build-arg NODE_VERSION=22 - `otel-v1/.npmrc` - Isolation config for v1 - `otel-v2/package.json` - OTel 2.x version constraints - `otel-v2/.npmrc` - Isolation config for v2 -- `.github/workflows/otel-js-test.yaml` - Dedicated CI workflow +- `.github/workflows/checks.yaml` - Consolidated CI workflow diff --git a/js/Makefile b/js/Makefile index 0e1a9b396..f2786c9de 100644 --- a/js/Makefile +++ b/js/Makefile @@ -8,6 +8,8 @@ help: @echo " make clean - Clean build artifacts" @echo " make install-optional-deps - Install optional dependencies" @echo " make test - Run all tests (core + wrappers + ai-sdk)" + @echo " make test-checks - Run hermetic tests only" + @echo " make test-external - Run provider-backed tests only" @echo " make test-core - Run core tests only" @echo " make test-openai - Run OpenAI wrapper tests" @echo " make test-anthropic - Run Anthropic wrapper tests" @@ -20,6 +22,7 @@ help: @echo " make test-api-compat - Run API compatibility tests" @echo " make bench - Run queue performance benchmarks" @echo " make test-latest - Run core + latest versions of wrappers" + @echo " make verify-checks - Build, docs, and hermetic tests" @echo "" @echo "Smoke tests (mimics CI workflow):" @echo " make test-smoke - Run all smoke tests (auto-prepares)" @@ -28,7 +31,7 @@ help: @echo "" @echo "See smoke/README.md for details on smoke test infrastructure" -.PHONY: help bench build clean test test-core test-openai test-anthropic test-google-genai test-ai-sdk test-ai-sdk-v5 test-ai-sdk-v6 test-claude-agent-sdk test-vitest test-latest install-optional-deps publish-beta-local test-smoke +.PHONY: help bench build clean test test-checks test-external test-core test-openai test-anthropic test-google-genai test-ai-sdk test-ai-sdk-v5 test-ai-sdk-v6 test-claude-agent-sdk test-vitest test-latest install-optional-deps publish-beta-local test-smoke # ------------------------------------------------------------------------------------------------- # # Anthropic testing @@ -104,7 +107,7 @@ test-openai-%: # common things # ------------------------------------------------------------------------------------------------- -.PHONY: test-pnpm test test-latest prune installing-optional-deps docs build verify-ci bench test-api-compat +.PHONY: test-pnpm test test-checks test-external test-latest prune installing-optional-deps docs build verify-checks verify-ci bench test-api-compat install-optional-deps: npm_config_save=false npm_config_lockfile=false pnpm add \ @@ -121,8 +124,14 @@ test-core: test-api-compat: pnpm test:api-compat +# Test only hermetic suites. +test-checks: test-core test-vitest test-claude-agent-sdk + +# Test only provider-backed suites. +test-external: test-openai test-anthropic test-google-genai test-ai-sdk + # Test everything -test: test-core test-openai test-anthropic test-google-genai test-ai-sdk test-vitest test-claude-agent-sdk +test: test-checks test-external # Test the core and the latest versions of wrappers. test-latest: test-core test-anthropic-latest test-openai-latest test-google-genai test-ai-sdk test-vitest test-claude-agent-sdk @@ -146,7 +155,9 @@ bench: # note: we don't use the docs in ci, but this makes sure they keep building -verify-ci: build docs test +verify-checks: build docs test-checks + +verify-ci: verify-checks test-external publish-sdk-js: ./scripts/validate-release.sh diff --git a/js/smoke/README.md b/js/smoke/README.md index ff060a0f2..7bdad6a18 100644 --- a/js/smoke/README.md +++ b/js/smoke/README.md @@ -229,11 +229,11 @@ Scenarios automatically create tarballs if they're not provided via environment - Cached for subsequent runs (fast) - Run from any level: `sdk/js/`, `sdk/js/smoke/`, or scenario directory -**In CI** (`.github/workflows/js.yaml`): +**In CI** (`.github/workflows/checks.yaml`): -1. **Build job**: Creates all tarballs (braintrust, otel, templates-nunjucks), uploads as artifacts -2. **Smoke-discover job**: Auto-discovers all scenarios (local + integration) -3. **Smoke-test job**: Downloads tarballs, runs all scenarios in parallel with `fail-fast: false` +1. **`js-build` job**: Creates all tarballs (braintrust, otel, templates-nunjucks), uploads as artifacts +2. **`js-smoke-discover` job**: Auto-discovers all scenarios (local + integration) +3. **`js-smoke-test` job**: Downloads tarballs, runs all scenarios in parallel with `fail-fast: false` ## Integration Scenarios From db7462ede4f12c82c3db89e7e702f579160ee78b Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 12 Mar 2026 12:13:07 +0100 Subject: [PATCH 2/4] Fix --- .github/workflows/checks.yaml | 6 +++++- js/Makefile | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index bbb38d622..d4dd6bf6a 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -434,6 +434,10 @@ jobs: working-directory: ./js run: | pnpm add -D zod@${{ matrix.zod-version }} + - name: Build JS package + working-directory: ./js + run: | + pnpm run build - name: Run hermetic JS tests working-directory: ./js shell: bash @@ -478,7 +482,7 @@ jobs: local job_name="$1" local job_result="$2" - if [ "$job_result" != "success" ]; then + if [ "$job_result" != "success" ] && [ "$job_result" != "skipped" ]; then echo "Job '$job_name' finished with result: $job_result" FAILED=1 fi diff --git a/js/Makefile b/js/Makefile index f2786c9de..cc9a84264 100644 --- a/js/Makefile +++ b/js/Makefile @@ -125,10 +125,10 @@ test-api-compat: pnpm test:api-compat # Test only hermetic suites. -test-checks: test-core test-vitest test-claude-agent-sdk +test-checks: test-core test-vitest # Test only provider-backed suites. -test-external: test-openai test-anthropic test-google-genai test-ai-sdk +test-external: test-openai test-anthropic test-google-genai test-ai-sdk test-claude-agent-sdk # Test everything test: test-checks test-external From 1a7afb29a1050d7d91b92cafadc6f1088799dd43 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 12 Mar 2026 12:23:32 +0100 Subject: [PATCH 3/4] Fix --- .github/workflows/checks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index d4dd6bf6a..b373a6a52 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -325,6 +325,7 @@ jobs: working-directory: js/smoke shell: bash env: + BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} CI: true BRAINTRUST_TAR: ../artifacts/braintrust-latest.tgz BRAINTRUST_BROWSER_TAR: ../artifacts/braintrust-browser-latest.tgz From 1fe844cd3fcb1dee584d4489647a8234db160dcc Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 13 Mar 2026 11:04:22 +0100 Subject: [PATCH 4/4] use tool versions in ci --- .github/workflows/checks.yaml | 10 +++++----- .github/workflows/integration-tests.yaml | 2 +- .github/workflows/npm-download-stats.yaml | 2 +- .github/workflows/publish-js-sdk.yaml | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index b373a6a52..7562d67ae 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 22 + node-version-file: .tool-versions - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: pnpm install --frozen-lockfile @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 22 + node-version-file: .tool-versions - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: pnpm install --frozen-lockfile @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 22 + node-version-file: .tool-versions - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: pnpm install --frozen-lockfile @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 22 + node-version-file: .tool-versions - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: pnpm install --frozen-lockfile @@ -427,7 +427,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: "22" + node-version-file: .tool-versions cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index a69115695..0c9ca87de 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20 + node-version-file: .tool-versions - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/npm-download-stats.yaml b/.github/workflows/npm-download-stats.yaml index 7634c94f5..e8d0b5878 100644 --- a/.github/workflows/npm-download-stats.yaml +++ b/.github/workflows/npm-download-stats.yaml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: "22" + node-version-file: .tool-versions - name: Report download stats to Datadog env: diff --git a/.github/workflows/publish-js-sdk.yaml b/.github/workflows/publish-js-sdk.yaml index 883d82806..3f88cffe5 100644 --- a/.github/workflows/publish-js-sdk.yaml +++ b/.github/workflows/publish-js-sdk.yaml @@ -57,7 +57,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: "20" + node-version-file: .tool-versions - name: Determine release metadata id: release_metadata working-directory: js @@ -109,7 +109,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: "20" + node-version-file: .tool-versions registry-url: "https://registry.npmjs.org" - name: Install npm 11.6.2 run: npm install -g npm@11.6.2 @@ -180,7 +180,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: "20" + node-version-file: .tool-versions registry-url: "https://registry.npmjs.org" - name: Install npm 11.6.2 run: npm install -g npm@11.6.2