diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 6bfd73ae2..eb1f18320 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -146,6 +146,9 @@ jobs: e2e: runs-on: ubuntu-latest timeout-minutes: 30 + env: + BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} + BRAINTRUST_E2E_PROJECT_NAME: ${{ vars.BRAINTRUST_E2E_PROJECT_NAME }} steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 @@ -156,10 +159,33 @@ jobs: node-version-file: .tool-versions - name: Setup pnpm uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 + - name: Prepare e2e run context directory + id: run_context + shell: bash + run: | + RUN_CONTEXT_DIR="$(mktemp -d)" + echo "dir=$RUN_CONTEXT_DIR" >> "$GITHUB_OUTPUT" - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run e2e tests + env: + BRAINTRUST_E2E_RUN_CONTEXT_DIR: ${{ steps.run_context.outputs.dir }} run: pnpm run test:e2e + - name: Build e2e Braintrust links summary + if: ${{ always() && steps.run_context.outputs.dir != '' }} + shell: bash + env: + BRAINTRUST_E2E_RUN_CONTEXT_DIR: ${{ steps.run_context.outputs.dir }} + BRAINTRUST_ORG_NAME: ${{ vars.BRAINTRUST_ORG_NAME }} + GITHUB_HEAD_REF: ${{ github.head_ref }} + GITHUB_REF_NAME: ${{ github.ref_name }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_RUN_ID: ${{ github.run_id }} + GITHUB_SERVER_URL: ${{ github.server_url }} + run: | + SUMMARY_PATH="$RUNNER_TEMP/e2e-braintrust-links-summary.md" + node e2e/scripts/build-pr-e2e-links-comment.mjs --output "$SUMMARY_PATH" + cat "$SUMMARY_PATH" >> "$GITHUB_STEP_SUMMARY" js-api-compatibility: runs-on: ubuntu-latest diff --git a/turbo.json b/turbo.json index ae460ea25..965f56b20 100644 --- a/turbo.json +++ b/turbo.json @@ -34,6 +34,11 @@ }, "test:e2e": { "cache": false, + "env": [ + "BRAINTRUST_API_KEY", + "BRAINTRUST_E2E_PROJECT_NAME", + "BRAINTRUST_E2E_RUN_CONTEXT_DIR" + ], "dependsOn": ["^build"], "outputs": [] },