Skip to content

Commit 05b5588

Browse files
authored
improvement(ci): parallelize Docker builds and fix test timeouts (#4083)
* improvement(ci): parallelize Docker builds with tests and remove duplicate turbo install * fix(test): use SecureFetchResponse shape in mock instead of standard Response
1 parent 32bdf3c commit 05b5588

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
# Build AMD64 images and push to ECR immediately (+ GHCR for main)
4949
build-amd64:
5050
name: Build AMD64
51-
needs: [test-build, detect-version]
51+
needs: [detect-version]
5252
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/dev')
5353
runs-on: blacksmith-8vcpu-ubuntu-2404
5454
permissions:
@@ -150,7 +150,7 @@ jobs:
150150
# Build ARM64 images for GHCR (main branch only, runs in parallel)
151151
build-ghcr-arm64:
152152
name: Build ARM64 (GHCR Only)
153-
needs: [test-build, detect-version]
153+
needs: [detect-version]
154154
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
155155
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
156156
permissions:

apps/sim/tools/index.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,17 @@ describe('Automatic Internal Route Detection', () => {
487487
cleanupEnvVars = setupEnvVars({ NEXT_PUBLIC_APP_URL: 'http://localhost:3000' })
488488

489489
mockValidateUrlWithDNS.mockResolvedValue({ isValid: true, resolvedIP: '93.184.216.34' })
490-
mockSecureFetchWithPinnedIP.mockResolvedValue(
491-
new Response(JSON.stringify({}), {
492-
status: 200,
493-
headers: { 'content-type': 'application/json' },
494-
})
495-
)
490+
mockSecureFetchWithPinnedIP.mockResolvedValue({
491+
ok: true,
492+
status: 200,
493+
statusText: 'OK',
494+
headers: {
495+
get: (name: string) => (name.toLowerCase() === 'content-type' ? 'application/json' : null),
496+
toRecord: () => ({ 'content-type': 'application/json' }),
497+
},
498+
text: async () => JSON.stringify({}),
499+
json: async () => ({}),
500+
})
496501
})
497502

498503
afterEach(() => {

docker/app.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ COPY packages/testing/package.json ./packages/testing/package.json
2525
COPY packages/logger/package.json ./packages/logger/package.json
2626
COPY packages/tsconfig/package.json ./packages/tsconfig/package.json
2727

28-
# Install turbo globally, then dependencies, then rebuild isolated-vm for Node.js
28+
# Install dependencies, then rebuild isolated-vm for Node.js
2929
# Use --linker=hoisted for flat node_modules layout (required for Docker multi-stage builds)
3030
RUN --mount=type=cache,id=bun-cache,target=/root/.bun/install/cache \
3131
--mount=type=cache,id=npm-cache,target=/root/.npm \
32-
bun install -g turbo && \
3332
HUSKY=0 bun install --omit=dev --ignore-scripts --linker=hoisted && \
3433
cd node_modules/isolated-vm && npx node-gyp rebuild --release
3534

0 commit comments

Comments
 (0)