Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,21 +236,17 @@ jobs:
key: ${{ github.repository }}-turbo-cache-build-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}
path: ./.turbo

# Keyed per commit so EVERY run saves its refreshed cache — a key without
# a unique suffix is written once and then frozen (GitHub caches are
# immutable per key; a primary-key hit skips the save), which left builds
# compiling against a cache stale since the last lockfile change. The
# restore-keys prefix match picks the most recently saved cache for this
# lockfile, falling back across lockfile changes.
- name: Restore Next.js build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
# Turbopack's persistent build cache (NEXT_TURBOPACK_BUILD_CACHE below)
# writes ~5 GB into .next/cache — a sticky disk mounts it in ~1s where an
# actions/cache round-trip would eat the warm-build win. Same event/fork
# namespacing as the other mounts; the GitHub fallback inside cache-mount
# still uses actions/cache with a run_id-suffixed key.
- name: Mount Next.js build cache
uses: ./.github/actions/cache-mount
with:
provider: ${{ vars.CI_PROVIDER }}
Comment thread
waleedlatif1 marked this conversation as resolved.
key: ${{ github.repository }}-nextjs-cache-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}
path: ./apps/sim/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('bun.lock') }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('bun.lock') }}-${{ github.sha }}-
${{ runner.os }}-nextjs-${{ hashFiles('bun.lock') }}-
${{ runner.os }}-nextjs-

- name: Install dependencies
run: bun install --frozen-lockfile
Expand All @@ -266,4 +262,7 @@ jobs:
AWS_REGION: 'us-west-2'
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
TURBO_CACHE_DIR: .turbo
run: bunx turbo run build --filter=sim
# Opt into Turbopack's persistent build cache (beta) for this CI
# check build only — measured 105s cold vs 22s warm locally.
NEXT_TURBOPACK_BUILD_CACHE: '1'
run: bunx turbo run build --filter=sim
6 changes: 6 additions & 0 deletions apps/sim/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ const nextConfig: NextConfig = {
experimental: {
optimizeCss: !isDev,
turbopackFileSystemCacheForDev: false,
/**
* Turbopack's persistent build cache (beta) — opt-in via env so only the
* CI check build uses it; production image builds stay on the default
* cold-build path until the feature stabilizes.
*/
turbopackFileSystemCacheForBuild: process.env.NEXT_TURBOPACK_BUILD_CACHE === '1',
preloadEntriesOnStart: false,
optimizePackageImports: [
'lodash',
Expand Down
Loading