Skip to content

chore(ci): Cache prebuild entries#1742

Merged
Tobbe merged 3 commits into
mainfrom
tobbe-chore-ci-cache-prebuild-downloads
May 10, 2026
Merged

chore(ci): Cache prebuild entries#1742
Tobbe merged 3 commits into
mainfrom
tobbe-chore-ci-cache-prebuild-downloads

Conversation

@Tobbe

@Tobbe Tobbe commented May 10, 2026

Copy link
Copy Markdown
Member

Windows CI has been flaky. Analyzing the logs it sees it often fails to download better-sqlite3 native binaries. It then falls back to manually building them, which always fails on Windows.

The download has been failing on Ubuntu too from time to time, but when it does and falls back to building it succeeds with the build, and CI for Ubuntu passes. But building is slow. Downloading prebuilt bins is faster.

Caching the bins when we do succeed in downloading them works around flaky downloads, and hopefully makes it even faster than actual downloads even if they had been fully stable

@netlify

netlify Bot commented May 10, 2026

Copy link
Copy Markdown

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit b17d253
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a00e97ff259fa0008ce21e5

@github-actions github-actions Bot added this to the chore milestone May 10, 2026
@greptile-apps

greptile-apps Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds caching for prebuild-install native binaries (primarily better-sqlite3) to reduce flaky Windows CI failures caused by unreliable downloads of prebuilt .node files.

  • Adds a step to detect the platform-specific _prebuilds cache directory ($HOME/.npm/_prebuilds on Linux/macOS, $APPDATA/npm-cache/_prebuilds on Windows) and another step to extract the installed better-sqlite3 version from yarn.lock using a Yarn v4-compatible grep pattern.
  • Inserts actions/cache/restore before yarn install (so prebuild-install can find cached binaries and skip downloading) and actions/cache/save after yarn install, with continue-on-error: true on both so failures don't break CI.

Confidence Score: 5/5

Safe to merge — the cache steps are additive, wrapped with continue-on-error, and don't touch any existing functionality.

The version extraction grep uses the correct Yarn v4 lockfile format, the cache key is version-aware preventing stale binary hits across upgrades, restore and save keys match, and both cache steps use continue-on-error so a cache miss or wrong path is a silent no-op rather than a CI failure.

No files require special attention.

Important Files Changed

Filename Overview
.github/actions/set-up-job/action.yml Adds prebuild-install cache restore/save steps with correct Yarn v4 grep pattern, version-aware cache key, and continue-on-error safety net; logic and ordering look sound

Reviews (3): Last reviewed commit: "fix grep syntax" | Re-trigger Greptile

Comment thread .github/actions/set-up-job/action.yml Outdated
Comment thread .github/actions/set-up-job/action.yml Outdated
Comment thread .github/actions/set-up-job/action.yml Outdated
@nx-cloud

nx-cloud Bot commented May 10, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit b17d253

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 3m 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-10 20:58:47 UTC

@nx-cloud

nx-cloud Bot commented May 10, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 99dea8c

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 9s View ↗
nx run-many -t test:types ✅ Succeeded 10s View ↗
nx run-many -t build ✅ Succeeded 6s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-10 18:56:43 UTC

Comment thread .github/actions/set-up-job/action.yml Outdated
@Tobbe Tobbe merged commit e5228dd into main May 10, 2026
71 of 75 checks passed
@Tobbe Tobbe deleted the tobbe-chore-ci-cache-prebuild-downloads branch May 10, 2026 21:05
Tobbe added a commit that referenced this pull request May 12, 2026
Windows CI has been flaky. Analyzing the logs it sees it often fails to
download better-sqlite3 native binaries. It then falls back to manually
building them, which always fails on Windows.

The download has been failing on Ubuntu too from time to time, but when
it does and falls back to building it succeeds with the build, and CI
for Ubuntu passes. But building is slow. Downloading prebuilt bins is
faster.

Caching the bins when we do succeed in downloading them works around
flaky downloads, and hopefully makes it even faster than actual
downloads even if they had been fully stable
@Tobbe Tobbe modified the milestones: chore, v4.2.0 May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant