Skip to content

ci: cache SwiftPM + compile once (faster build) - #108

Merged
karansinghgit merged 1 commit into
mainfrom
ci/cache-spm-single-compile
Jul 28, 2026
Merged

ci: cache SwiftPM + compile once (faster build)#108
karansinghgit merged 1 commit into
mainfrom
ci/cache-spm-single-compile

Conversation

@karansinghgit

Copy link
Copy Markdown
Owner

Two low-risk speedups for the ~3-minute build job.

Changes

  1. Cache resolved Swift packages (actions/cache, keyed on Package.resolved), resolved into a repo-local SourcePackages dir via -clonedSourcePackagesDirPath. Stops WhisperKit / FluidAudio / swift-transformers / DSWaveformImage from being re-fetched and recompiled every run.
  2. Compile once. The old job ran a full build and a full test (which recompiled the app). Replaced with build-for-testingtest-without-building — a single compile, same signals (build gate + tests).
  3. Preinstalled SwiftLint instead of brew install on every run (brew fallback kept).

Expected impact

Build job should drop from ~3 min toward ~1–1.5 min on cache hits (first run seeds the cache). Lint stays advisory and off the critical path.

Notes

  • The self-test is this PR's own CI run: first run seeds the SwiftPM cache; a re-run should show the cache restored and a faster build.
  • Bigger follow-up (not in this PR): a tag-triggered signed-release GitHub Actions workflow so releases don't require a local Mac — needs Developer ID + notary creds as repo secrets. Happy to scaffold it separately.

Two low-risk wins for the ~3-minute build job:

- Cache resolved Swift packages (WhisperKit, FluidAudio, swift-transformers,
  DSWaveformImage) via actions/cache, keyed on Package.resolved and resolved
  into a repo-local SourcePackages dir. Avoids re-fetching + recompiling every
  dependency on every run.
- Replace the separate 'build' + 'test' steps (which compiled the app twice)
  with build-for-testing + test-without-building — one compile.
- Use the runner's preinstalled SwiftLint instead of 'brew install' each run
  (fallback kept just in case).
@karansinghgit
karansinghgit merged commit 330be6c into main Jul 28, 2026
2 checks passed
@karansinghgit
karansinghgit deleted the ci/cache-spm-single-compile branch July 28, 2026 08:02
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