mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-30 19:49:14 +00:00
bun ignores bunfig.toml's timeout key, and beforeAll/beforeEach hooks do NOT inherit a test's third-arg timeout — a bare `bun test` gives every hook the 5000ms default even when all tests in the file declare 30s+. Measured on bun 1.3.14: a 6s hook dies at ~5001ms with the signature `(unnamed) [5001ms] ... hook timed out` (the #3545 jsonb-parity CI failure); both `beforeAll(fn, ms)` and the CLI `--timeout` flag are enforced hook budgets (kills observed at exactly the configured ms). Fixes: - e2e.yml (jsonb-parity, tier1, tier2) and release.yml ran bare `bun test`; they now pass --timeout=60000 like every scripts/ runner. - test/e2e/jsonb-roundtrip.test.ts (the #2339 double-encode guard, which only real Postgres can surface) additionally carries per-hook 60s budgets so a bare local run can't flake either — same pattern as its sibling op-checkpoint-jsonb-parity.test.ts. - scripts/check-bun-test-timeout.sh: CI guard (run from test.yml's verify job) failing any future bare `bun test` in workflows/scripts. - scripts/run-e2e.sh: correct the comment claiming --timeout is per-test-only (it covers hooks; the outer gtimeout exists for sync-blocking WASM hangs where no timer can fire). Proof: with Postgres paused for 6s during setupDB's connect, the unfixed file fails at 5001.81ms with the exact CI signature; the fixed file passes the identical condition (5 pass, 6.57s). 396 slow before-hooks across 362 test files lack per-hook budgets; all of them run through --timeout-passing invocations after this change, enforced by the new guard. Co-authored-by: Garry Tan <garrytan@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
target: bun-darwin-arm64
|
|
artifact: gbrain-darwin-arm64
|
|
- os: ubuntu-latest
|
|
target: bun-linux-x64
|
|
artifact: gbrain-linux-x64
|
|
runs-on: ${{ matrix.os }}
|
|
permissions:
|
|
contents: read
|
|
id-token: write # for attest-build-provenance (Sigstore OIDC)
|
|
attestations: write # for attest-build-provenance
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
with:
|
|
bun-version: 1.3.13
|
|
- run: bun install
|
|
# --timeout matches every scripts/ runner and covers hook budgets too
|
|
# (bunfig.toml's timeout key is ignored by bun; hooks default to 5s).
|
|
- run: bun test --timeout=60000
|
|
- run: bun run verify
|
|
- run: bun build --compile --target=${{ matrix.target }} --outfile bin/${{ matrix.artifact }} src/cli.ts
|
|
- name: Attest build provenance
|
|
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
|
|
with:
|
|
subject-path: bin/${{ matrix.artifact }}
|
|
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
with:
|
|
name: ${{ matrix.artifact }}
|
|
path: bin/${{ matrix.artifact }}
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
with:
|
|
path: artifacts
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
|
|
with:
|
|
files: |
|
|
artifacts/gbrain-darwin-arm64/gbrain-darwin-arm64
|
|
artifacts/gbrain-linux-x64/gbrain-linux-x64
|
|
generate_release_notes: true
|