v0.6.54.0 ci: turbo remote cache + path filter + native caches#336
Conversation
There was a problem hiding this comment.
Pull request overview
CI wall-clock optimization for the existing GitHub Actions workflows. Adds a Turbo remote cache (backed by the GH Actions cache), path-filtered desktop/mobile packaging jobs on PRs, and native-toolchain caches (electron-builder, Gradle, CocoaPods). No application/source code is changed.
Changes:
- Add
dtinth/setup-github-actions-caching-for-turbo@v1to every job that runspnpm buildacrossbuild.yml,evals.yml, andrelease.yml, plus setTURBO_TELEMETRY_DISABLED=1. - New
changesjob usingdorny/paths-filter@v3to skip the 5 desktop/mobile packaging jobs on PRs that don't touchapps/desktop/**,apps/mobile/**,packages/**, or lockfiles; push/tag events are unaffected viagithub.event_name != 'pull_request'. - Per-OS electron-builder caches,
gradle/actions/setup-gradle@v4, and CocoaPods caches added to the relevant jobs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Bumps version to 0.6.54.0. |
| CHANGELOG.md | Adds 0.6.54.0 entry describing the three CI changes. |
| .github/workflows/build.yml | Adds changes job, turbo cache step, electron-builder/Gradle/CocoaPods caches, and if:/needs: gating for desktop & mobile jobs. |
| .github/workflows/evals.yml | Adds turbo cache step to the evals job. |
| .github/workflows/release.yml | Adds turbo cache step and per-OS electron-builder caches in the release matrix. |
Comments suppressed due to low confidence (1)
.github/workflows/build.yml:81
dorny/paths-filter@v3on tag push events typically seesgithub.event.beforeas all zeros and falls back to treating all filters as changed (or, depending on configuration, may emit warnings). Because the downstreamif:short-circuits withgithub.event_name != 'pull_request', the outputs aren't consulted on tag pushes, but if thischangesjob ever fails on a tag push (e.g., due to a shallow checkout / missing base ref), the entireneeds: [test, changes]chain will block the release jobs and prevent a release from being produced. Consider either gating this job topull_requestevents only (see related comment), or addingif: always() && ...semantics on the dependents so a failed/skippedchangesjob cannot block tag-driven releases.
needs: [test, changes]
if: github.event_name != 'pull_request' || needs.changes.outputs.desktop == 'true'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mobile: | ||
| - 'apps/mobile/**' | ||
| - 'pnpm-lock.yaml' | ||
| - 'package.json' |
There was a problem hiding this comment.
Fixed in 6f707bc — added turbo.json to the mobile filter for symmetry with desktop. Good catch.
| changes: | ||
| name: Detect changed paths | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| desktop: ${{ steps.filter.outputs.desktop }} | ||
| mobile: ${{ steps.filter.outputs.mobile }} | ||
| steps: | ||
| - uses: actions/checkout@v6 |
There was a problem hiding this comment.
Acknowledged but won't fix: gating changes on pull_request would skip it on push events, and the dependent jobs declare needs: [test, changes] to be able to read needs.changes.outputs.* in their if: clauses. Skipping changes would skip the dependents (skipped != success in GH Actions' default needs semantics). Working around that requires if: always() && needs.test.result == 'success' && (...) on every dependent job — more complexity than the 6-second savings justify. Leaving as-is.
| - uses: dtinth/setup-github-actions-caching-for-turbo@v1 | ||
|
|
||
| - name: Cache electron-builder downloads | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/Library/Caches/electron | ||
| ~/Library/Caches/electron-builder | ||
| key: ${{ runner.os }}-electron-${{ hashFiles('apps/desktop/package.json', 'pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-electron- |
There was a problem hiding this comment.
Acknowledged — real DRY violation. Deferring to a follow-up PR that extracts a composite action (./.github/actions/setup-skytwin) bundling checkout + pnpm + node + turbo cache. Out of scope for this PR — keeping it focused on the wall-clock wins.
…ive-toolchain caches
Three changes to .github/workflows/{build,evals,release}.yml to slash CI
wall-clock without changing release artifact coverage:
1. Turbo remote cache via dtinth/setup-github-actions-caching-for-turbo@v1
on every job that runs `pnpm build`. The first job populates the GitHub
Actions cache; the 5+ downstream jobs (desktop-mac/win/linux, mobile-
android/ios, evals, release matrix) get `pnpm build` as cache hits across
the whole monorepo. No external account needed.
2. Path-filtered desktop + mobile jobs on PRs via dorny/paths-filter@v3.
PRs that don't touch apps/desktop/**, apps/mobile/**, packages/**, or
lockfiles skip the 5 desktop+mobile packaging jobs entirely. Push events
to main and tag pushes always run everything, so release artifacts are
unaffected.
3. Native-toolchain caches: electron-builder downloads (per-OS paths),
Gradle (gradle/actions/setup-gradle@v4), CocoaPods (Pods/ + global
cache). These were re-downloaded on every run before.
Public repo so Actions minutes are free; wall-clock is what we were burning.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
dtinth/setup-github-actions-caching-for-turbo@v1 writes to /tmp/turbogha.log, which doesn't exist on Windows runners (fails with ENOENT on D:\tmp). Skip on Windows only. Linux + macOS still get the turbo cache benefit. Electron-builder packaging dominates Windows wall-clock anyway; missing the TS-compile cache there is negligible. Caught by this PR's own CI run on the first push. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
For symmetry with the desktop filter — turbo.json changes can affect mobile build cache keys too. Copilot review caught the asymmetry. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6f707bc to
13c6d5a
Compare
Summary
CI wall-clock optimization. Three changes:
dtinth/setup-github-actions-caching-for-turbo@v1on every job. First job populates the GH Actions cache; 5+ downstream jobs getpnpm buildas cache hits across the monorepo. No external account needed (free Actions cache is the backend).dorny/paths-filter@v3. PRs that don't touchapps/desktop/**,apps/mobile/**,packages/**, or lockfiles skip the 5 desktop+mobile packaging jobs entirely. Push events tomainand tag pushes always run everything, so release artifacts are unchanged.gradle/actions/setup-gradle@v4), CocoaPods (Pods/+ global cache). These were re-downloaded on every run before.Public repo so Actions minutes are free; wall-clock is what we were burning. No code paths affected.
Why
Before: every PR rebuilt the entire TypeScript monorepo 6× (once per build/package job) and re-downloaded the electron toolchain on each desktop runner. After: 5 of those 6
pnpm builds become cache restores, and PRs that don't touch desktop/mobile skip 5 jobs entirely.Test plan
testjob populates turbo cache; subsequent jobs in same run show cache hits in thepnpm buildstep (look for "FULL TURBO" or per-taskcache hit, replaying logslines).github/workflows/**,VERSION,CHANGELOG.md— and.github/workflows/build.ymlis in the path filter so they WILL run once for self-validation)mainpush after merge, confirm all jobs run (path filter shouldn't apply to push events)🤖 Generated with Claude Code