Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 2, 2025

Summary

Two optimizations to speed up macOS CI builds for pull requests:

  1. Skip signing setup for PRs - electron-builder skips code signing for PRs anyway, but the Makefile was forcing sequential builds when CSC_LINK was set. Now we skip the signing setup step entirely for PRs, allowing parallel x64/arm64 builds.

  2. Skip bun cache restore on node_modules hit - The bun install cache (~470MB, ~104k files) only benefits bun install runs. When node_modules cache hits, we skip install entirely, so restoring the bun cache was wasting ~37s extracting unused files.

Results

Step Before After Saved
setup-mux 61s 24s 37s
Package for macOS 331s 168s 163s
Total 392s 192s 200s (51%)

Generated with mux

PR builds were running x64 and arm64 sequentially (~180s) because:
1. CSC_LINK was set by the signing setup script
2. Makefile sees CSC_LINK and forces sequential builds to avoid keychain conflicts
3. But electron-builder skips signing for PRs anyway!

Fix: Skip signing setup for PRs entirely. This allows the Makefile to
run both architectures in parallel, saving ~90 seconds per PR build.

Evidence from run #19845830777:
- 03:24:40 "🔐 Code signing enabled - building sequentially..."
- 03:26:12 "Current build is a part of pull request, code signing will be skipped"
- x64: 03:26:12 → 03:27:43 (~91s)
- arm64: 03:27:59 → 03:29:29 (~90s) - started AFTER x64 finished

With this change, both will build simultaneously.

_Generated with mux_
The bun install cache (~470MB, ~104k files) only benefits 'bun install'
runs. When node_modules cache hits, we skip install entirely, so
restoring the bun cache wastes ~37 seconds extracting files we never use.

Add condition to only restore bun cache on node_modules miss.
@ammario ammario merged commit 8125b40 into main Dec 2, 2025
13 checks passed
@ammario ammario deleted the macos-ci-parallelization-optimization branch December 2, 2025 04:00
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.

2 participants