Skip to content

Add sccache for CI build caching#251

Open
justjake wants to merge 11 commits intomainfrom
sccache-ci
Open

Add sccache for CI build caching#251
justjake wants to merge 11 commits intomainfrom
sccache-ci

Conversation

@justjake
Copy link
Owner

Summary

  • Add sccache with GitHub Actions cache backend for content-hash-based caching
  • Install emscripten locally (5.0.1) via setup-emsdk so sccache can wrap emcc
  • sccache caches based on content hashes, not mtimes, so works with fresh git clones

Changes

  • .github/workflows/main.yml: Add sccache action and setup-emsdk
  • scripts/emcc.sh: Wrap emcc with sccache when SCCACHE_GHA_ENABLED is set

Expected Results

  • First CI run: builds normally, populates sccache
  • Subsequent runs with same code: cache hits, significantly faster builds

Test plan

  • CI runs successfully
  • Check sccache stats for cache hit rate

🤖 Generated with Claude Code

justjake and others added 11 commits February 16, 2026 11:32
- Replace Yarn 4.0.2 with pnpm 10.29.3 as the package manager
- Add pnpm-workspace.yaml and .npmrc configuration
- Update all scripts to use pnpm commands
- Rename getYarnWorkspaces() to getWorkspaces() in scripts/helpers.ts
- Update CI workflow to use pnpm/action-setup@v4 with Node 22
- Add @jitl/tsconfig as root devDependency for proper resolution
- Add variant packages as devDependencies for test resolution
- Fix TypeScript 5.9 compatibility in memory.ts (Int32Array<ArrayBuffer>)
- Upgrade typedoc to 0.28.17 for TypeScript 5.9 support
- Upgrade typedoc-plugin-markdown to 4.10.0
- Regenerate documentation with new typedoc version

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Equivalent to yarn's YARN_ENABLE_SCRIPTS=0 - prevents prepare scripts
from running during install, which would fail on a fresh checkout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pnpm pack generates tarball names like jitl-quickjs-ffi-types-0.32.0.tgz
(without @ prefix, with version) instead of @jitl-quickjs-ffi-types.tgz

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The library now requires TypeScript 5.9+ due to stricter typed array
generics (Int32Array<ArrayBuffer>). Update all TypeScript-using examples.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
react-scripts@5 only supports TypeScript 3.x/4.x, but our library now
requires TypeScript 5.9+ for typed array generics. Use --legacy-peer-deps
to work around the peer dependency conflict.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use mozilla-actions/sccache-action with GitHub Actions cache backend
- Install emscripten locally via setup-emsdk (version 5.0.1) so sccache can wrap emcc
- Modify emcc.sh to use sccache wrapper when SCCACHE_GHA_ENABLED is set
- Add sccache stats output after build

sccache caches based on content hashes, not mtimes, so it works correctly
with fresh git clones in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Base automatically changed from pnpm-migration to main February 16, 2026 20:35
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