Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(ci): don't write next build cache always (#17292)

Nimarbb65111fff81
diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml
index dded16e063..d9c2e51b30 100644
--- a/.github/workflows/pipeline.yml
+++ b/.github/workflows/pipeline.yml
@@ -805,6 +805,7 @@ jobs:
- name: Build
run: pnpm turbo run build:test
env:
+ NEXT_DISABLE_BUILD_CACHE: "true"
NODE_OPTIONS: --max_old_space_size=8192
# TypeScript is checked explicitly in the lint job; skip duplicate
# Next.js type checks in test builds to reduce CI runtime.
@@ -814,6 +815,7 @@ jobs:
cp .env.runtime .env
pnpm --filter web exec dotenv -e ../.env -- next build --experimental-build-mode generate
env:
+ NEXT_DISABLE_BUILD_CACHE: "true"
NODE_OPTIONS: --max_old_space_size=8192
NEXT_IGNORE_BUILD_ERRORS: "true"
- name: Wait for dev containers
diff --git a/.github/workflows/warm-caches.yml b/.github/workflows/warm-caches.yml
index 09c253d4d9..d7f130e0d6 100644
--- a/.github/workflows/warm-caches.yml
+++ b/.github/workflows/warm-caches.yml
@@ -96,7 +96,7 @@ jobs:
# depends on db:generate, which is offline.
run: |
if [ "${{ matrix.env_profile }}" = "tests-web" ]; then
- pnpm turbo run build:test
+ NEXT_DISABLE_BUILD_CACHE=true pnpm turbo run build:test
else
pnpm run build --filter=!ai-gateway
fi
diff --git a/turbo.json b/turbo.json
index ce122ceaa7..1cb5ef2994 100644
--- a/turbo.json
+++ b/turbo.json
@@ -22,7 +22,7 @@
},
"build:test": {
"dependsOn": ["db:generate", "^build"],
- "env": ["NEXT_IGNORE_BUILD_ERRORS"],
+ "env": ["NEXT_IGNORE_BUILD_ERRORS", "NEXT_DISABLE_BUILD_CACHE"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"],
"cache": true,
"outputLogs": "errors-only"
diff --git a/web/next.config.mjs b/web/next.config.mjs
index 6a9b9fb599..2f492d11a8 100644
--- a/web/next.config.mjs
+++ b/web/next.config.mjs
@@ -150,6 +150,10 @@ const nextConfig = {
browserToTerminal: true,
},
experimental: {
+ // Ephemeral CI builds can skip writing compiler state they never restore.
+ ...(process.env.NEXT_DISABLE_BUILD_CACHE === "true"
+ ? { turbopackFileSystemCacheForBuild: false }
+ : {}),
// Use the Rust port instead of the Babel transform
// turbopackRustReactCompiler: true,
// Keep `new Worker(new URL(..., import.meta.url))` on the app origin when