Skip to content

Commit 7c0db52

Browse files
fix(ci): make GitHub-hosted fallback actually build and test
1 parent da56246 commit 7c0db52

5 files changed

Lines changed: 38 additions & 4 deletions

File tree

.github/actions/docker-build/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ inputs:
1919
tags:
2020
description: Comma-separated list of tags to push.
2121
required: true
22+
build-args:
23+
description: Newline-separated build args forwarded to the builder.
24+
required: false
25+
default: ''
2226

2327
# Registry logins must already have run in the calling job — both backends read
2428
# the same ~/.docker/config.json. provenance/sbom stay off everywhere: the
@@ -40,6 +44,7 @@ runs:
4044
platforms: ${{ inputs.platforms }}
4145
push: true
4246
tags: ${{ inputs.tags }}
47+
build-args: ${{ inputs.build-args }}
4348
provenance: false
4449
sbom: false
4550

@@ -51,6 +56,11 @@ runs:
5156
# the GitHub equivalent (cache-to: type=gha) shares the same 10 GB repo
5257
# cache quota as the bun/node_modules/turbo mounts, and four images of
5358
# layers would evict them. Fallback builds are cold by design.
59+
# NEXT_BUILD_HEAP_MB is trimmed from the 8192 default here because these
60+
# runners have 16 GB total and `next build` was getting OOM-killed (exit
61+
# 137) partway through. Only app.Dockerfile declares the arg; the other
62+
# images ignore it harmlessly, so it is set unconditionally rather than
63+
# threaded per-image through every call site.
5464
- name: Build and push (GitHub)
5565
if: inputs.provider != '' && inputs.provider != 'blacksmith'
5666
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
@@ -60,5 +70,8 @@ runs:
6070
platforms: ${{ inputs.platforms }}
6171
push: true
6272
tags: ${{ inputs.tags }}
73+
build-args: |
74+
NEXT_BUILD_HEAP_MB=4096
75+
${{ inputs.build-args }}
6376
provenance: false
6477
sbom: false

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ name: CI
2121
# branch would hard-fail.
2222
#
2323
# GitHub mode is a break-glass fallback, not a peer. Public-repo ubuntu-latest is
24-
# 4 vCPU with no free 8-core tier, the 10 GB repo cache quota will thrash across
25-
# the bun/node_modules/turbo mounts, and image builds start from cold layers — so
26-
# expect slower runs, not different results. Blacksmith-only actions are reached
24+
# 4 vCPU / 16 GB with no free 8-core tier, the 10 GB repo cache quota will thrash
25+
# across the bun/node_modules/turbo mounts, and image builds start from cold
26+
# layers. The first live flip (2026-07-21) proved it is not merely slower: the
27+
# app image OOM-killed `next build`, and one test failed because it shells out to
28+
# `rg`, which Blacksmith's image ships and GitHub's does not. Both are addressed
29+
# now — ripgrep is installed explicitly in test-build.yml, and the GitHub path
30+
# trims NEXT_BUILD_HEAP_MB — but the app image build stays the tight spot here
31+
# and is the first thing to check if a fallback run fails. Blacksmith-only
32+
# actions are reached
2733
# exclusively through .github/actions/cache-mount and .github/actions/docker-build,
2834
# which branch internally; a bare useblacksmith/* step added anywhere else will
2935
# hard-fail in GitHub mode rather than silently degrade.

.github/workflows/test-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ jobs:
153153
- name: Type-check realtime server
154154
run: bunx turbo run type-check --filter=@sim/realtime
155155

156+
# cloud-review-tools.test.ts runs the real helper script, which shells out
157+
# to `rg`. In production that script runs inside the E2B sandbox, whose
158+
# template apt-installs ripgrep — but the test executes it on the runner,
159+
# so the runner needs it too. Blacksmith's image ships rg and GitHub's does
160+
# not, which made this an invisible dependency on the runner provider.
161+
- name: Install ripgrep
162+
run: command -v rg || (sudo apt-get update && sudo apt-get install -y ripgrep)
163+
156164
- name: Run tests with coverage
157165
env:
158166
NODE_OPTIONS: '--no-warnings --max-old-space-size=8192'

apps/sim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"load:workflow:baseline": "BASE_URL=${BASE_URL:-http://localhost:3000} WARMUP_DURATION=${WARMUP_DURATION:-10} WARMUP_RATE=${WARMUP_RATE:-2} PEAK_RATE=${PEAK_RATE:-8} HOLD_DURATION=${HOLD_DURATION:-20} bunx artillery run scripts/load/workflow-concurrency.yml",
1818
"load:workflow:waves": "BASE_URL=${BASE_URL:-http://localhost:3000} WAVE_ONE_DURATION=${WAVE_ONE_DURATION:-10} WAVE_ONE_RATE=${WAVE_ONE_RATE:-6} QUIET_DURATION=${QUIET_DURATION:-5} WAVE_TWO_DURATION=${WAVE_TWO_DURATION:-15} WAVE_TWO_RATE=${WAVE_TWO_RATE:-8} WAVE_THREE_DURATION=${WAVE_THREE_DURATION:-20} WAVE_THREE_RATE=${WAVE_THREE_RATE:-10} bunx artillery run scripts/load/workflow-waves.yml",
1919
"load:workflow:isolation": "BASE_URL=${BASE_URL:-http://localhost:3000} ISOLATION_DURATION=${ISOLATION_DURATION:-30} TOTAL_RATE=${TOTAL_RATE:-9} WORKSPACE_A_WEIGHT=${WORKSPACE_A_WEIGHT:-8} WORKSPACE_B_WEIGHT=${WORKSPACE_B_WEIGHT:-1} bunx artillery run scripts/load/workflow-isolation.yml",
20-
"build": "bun run build:sandbox-bundles && NODE_OPTIONS='--max-old-space-size=8192' next build",
20+
"build": "bun run build:sandbox-bundles && NODE_OPTIONS=--max-old-space-size=${NEXT_BUILD_HEAP_MB:-8192} next build",
2121
"build:sandbox-bundles": "bun run ./lib/execution/sandbox/bundles/build.ts",
2222
"start": "next start",
2323
"prepare": "cd ../.. && bun husky",

docker/app.Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ ENV DATABASE_URL=${DATABASE_URL}
7676
ARG NEXT_PUBLIC_APP_URL="http://localhost:3000"
7777
ENV NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
7878

79+
# V8 old-space ceiling for `next build`. Turbopack's own allocations are native
80+
# and sit outside this budget, so the ceiling has to leave room for them plus
81+
# the daemon and BuildKit — on a 16 GB runner the default 8192 is enough to get
82+
# the process OOM-killed. Only the heap size changes; build output does not.
83+
ARG NEXT_BUILD_HEAP_MB=8192
84+
ENV NEXT_BUILD_HEAP_MB=${NEXT_BUILD_HEAP_MB}
85+
7986
# Per-platform cache id keeps arm64/amd64 SWC artifacts isolated.
8087
RUN --mount=type=cache,id=next-cache-${TARGETPLATFORM},target=/app/apps/sim/.next/cache \
8188
--mount=type=cache,id=turbo-cache-${TARGETPLATFORM},target=/app/.turbo \

0 commit comments

Comments
 (0)