-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (86 loc) · 3.83 KB
/
Copy pathbenchmarks.yml
File metadata and controls
95 lines (86 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: benchmarks
# Smoke-level gate for `benchmarks/` — proves the suite still COMPILES and
# still RUNS against the current `src/` API. It does not measure anything:
# benchmark numbers from a shared CI runner are noise, and regressions in
# throughput are not what this catches.
#
# Why it exists: nothing used to look at `benchmarks/` at all. `bun run
# typecheck` uses the build tsconfig, which deliberately EXCLUDES the
# benchmarks; `test.yml` does not even trigger on `benchmarks/**`. So when
# the free `ask()` helper was removed in favour of `ref.ask()`, ten suites
# were left importing a non-existent export and `bun run bench` stayed dead
# for months without a single red build (#506).
#
# Triggers on `src/**` too, not just `benchmarks/**` — the failure mode is
# a *source* change orphaning a benchmark, which is invisible from the
# benchmark side of the diff.
on:
# Run on every branch push (feature work merges locally, so a branch push
# is often the only pre-merge signal), not just `develop`.
push:
branches: ['**']
paths:
- 'src/**'
- 'benchmarks/**'
- 'package.json'
- 'bun.lock'
- 'tsconfig.json'
- 'tsconfig.bench.json'
- '.github/workflows/benchmarks.yml'
pull_request:
branches: [main, develop]
paths:
- 'src/**'
- 'benchmarks/**'
- 'package.json'
- 'bun.lock'
- 'tsconfig.json'
- 'tsconfig.bench.json'
- '.github/workflows/benchmarks.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Least privilege, stated rather than inherited: the repository default is
# read-only today, but a settings flip would otherwise hand a write token to
# a job that installs and runs the whole dependency tree. #621
permissions:
contents: read
jobs:
benchmarks:
runs-on: ubuntu-latest
# Smoke mode runs the whole suite in well under a minute locally; the cap
# is here so a benchmark that HANGS (a cluster that never converges, a
# worker that never replies) fails the job instead of burning an hour.
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
# Frozen, like every other install in CI: an unfrozen resolve can
# green-light a dependency set no lockfile records, so the check
# passes against something nobody can reproduce. #622
- name: Install
run: bun install --frozen-lockfile
- name: Typecheck benchmarks
# The stricter of the two checks for this failure class: a missing
# barrel export is a TS2305 here even when the imported binding is
# never called, whereas Bun happily elides an unused named import at
# runtime. Cheap — seconds — so it runs first and fails fast.
run: bun run typecheck:bench
- name: Run benchmarks (smoke mode)
# ACTOR_TS_BENCH_SMOKE=1 collapses every case to a single unwarmed
# iteration, so this is "does each suite still execute", not a
# measurement. Catches what the typecheck cannot: wiring that is
# type-correct but wrong at runtime.
#
# `worker` is excluded on hosted runners for the same reason the
# worker-thread multi-node test suites are quarantined there (see
# test.yml + #538): Bun on GitHub's runners cannot respawn functional
# worker threads after the first, and worker-count-scaling.ts spawns
# 1 → 2 → 4 → 8 → auto in one process. It runs locally via
# `bun run bench:smoke`. The exclusion shares the quarantine's exit
# criterion — `nightly-flakes.yml` is what measures it.
run: bun run bench:smoke -- --exclude=worker