Skip to content

ci: cache the Cocoa SDK build - #5781

Merged
ric-oliv merged 1 commit into
mainfrom
ci/cache-cocoa-sdk-build
Oct 23, 2026
Merged

ric-oliv merged 1 commit into
mainfrom
ci/cache-cocoa-sdk-build

Conversation

@ric-oliv

@ric-oliv ric-oliv commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The macOS build job builds the Cocoa SDK from the sentry-cocoa submodule on every run. In the binlog of run 39921957359, that's 12.2 of the 23.7 minutes in the Build step, on one of the three MSBuild nodes. The other two run out of work by minute 10 and wait for the Cocoa bindings. The iOS device tests build it too.

version7 has cached it since #5746, and this PR brings the same steps to main:

  • A cocoa-cache-key action keyed on the selected Xcode, build-sentry-cocoa.sh, sentry-cocoa.xcconfig and the submodule commit.
  • Restore before the build, and save after a build that wrote the stamp, in the macOS leg and in the iOS device tests.
  • Release branches skip the restore and build it from source, because it ships in the Sentry.Bindings.Cocoa package.

I left out the warm-up workflow, because pushes to main already run build.yml and save the cache for every PR. I also left out the pin-xcode action, which only the warm-up uses, and the verify-api change, which I'll send separately. The Cocoa steps match version7 line for line, so the next merge between the branches stays clean.

Measured against the median of 7 main runs from October 22 and 23:

main First run, cache miss Reruns, cache hit
iOS Device Tests job 42.5 min 31.4 21.9
Build iOS Test App 6.1 to 12.6 6.7 1.7
macOS Build step 23.7 19.9 22.3 and 17.2
  • On the reruns, both jobs restored the cache and skipped saving it.
  • The iOS job gains the most, because its app build was waiting for the Cocoa SDK.
  • The macOS Build step gains less than the 12 minutes the Cocoa build took, because the rest of the step keeps all three cores busy and the app samples become its tail. ci: build the app samples in their own job #5783 moves those samples into their own job, and with both changes the step took 6.6 minutes.
  • I didn't compare the whole workflow, because the second rerun's time came from a linux-x64 runner that spent 28 minutes in Setup Environment.

#skip-changelog

The macOS build job and the iOS device tests build the Cocoa SDK from the
sentry-cocoa submodule on every run. In the macOS Build step on main, that
takes 12.2 of 23.7 minutes on one MSBuild node, and the other two nodes go
idle waiting for the Cocoa bindings. version7 caches it since #5746, and
this brings the same steps to main.

The key covers the selected Xcode, build-sentry-cocoa.sh,
sentry-cocoa.xcconfig and the submodule commit. Pushes to main save the
cache, so pull requests restore it from there. Release branches still build
it from source, because it ships in the Sentry.Bindings.Cocoa package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ric-oliv
ric-oliv marked this pull request as ready for review October 23, 2026 09:24
@ric-oliv
ric-oliv requested a review from bitsandfoxes October 23, 2026 09:24
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.13%. Comparing base (f080ba4) to head (09c2c55).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5781      +/-   ##
==========================================
+ Coverage   76.12%   76.13%   +0.01%     
==========================================
  Files         528      528              
  Lines       19579    19579              
  Branches     3829     3829              
==========================================
+ Hits        14904    14906       +2     
+ Misses       3792     3791       -1     
+ Partials      883      882       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bitsandfoxes bitsandfoxes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@ric-oliv
ric-oliv merged commit ff0355e into main Oct 23, 2026
86 checks passed
@ric-oliv
ric-oliv deleted the ci/cache-cocoa-sdk-build branch October 23, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants