ci(flutter): Align CI with stable SwiftPM defaults#3710
Conversation
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. FixesDart
Other
Internal Changes
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3710 +/- ##
==========================================
+ Coverage 86.96% 91.91% +4.95%
==========================================
Files 336 105 -231
Lines 11979 3734 -8245
==========================================
- Hits 10417 3432 -6985
+ Misses 1562 302 -1260
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c58ce03 | 1245.18 ms | 1247.00 ms | 1.82 ms |
| 101a9c7 | 1225.80 ms | 1236.04 ms | 10.25 ms |
| 67de70c | 1260.09 ms | 1266.79 ms | 6.71 ms |
| ea06d23 | 1254.02 ms | 1252.60 ms | -1.42 ms |
| 29e8ebe | 1260.46 ms | 1262.60 ms | 2.14 ms |
| 93b7728 | 1247.23 ms | 1264.87 ms | 17.64 ms |
| cdf371b | 1246.24 ms | 1251.10 ms | 4.86 ms |
| 2cb90b9 | 1272.90 ms | 1285.55 ms | 12.66 ms |
| 6b69699 | 1254.80 ms | 1273.31 ms | 18.52 ms |
| e5ae2a6 | 1240.48 ms | 1253.26 ms | 12.78 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c58ce03 | 5.73 MiB | 6.17 MiB | 455.86 KiB |
| 101a9c7 | 5.73 MiB | 6.17 MiB | 455.47 KiB |
| 67de70c | 5.73 MiB | 6.17 MiB | 455.45 KiB |
| ea06d23 | 5.53 MiB | 5.96 MiB | 443.26 KiB |
| 29e8ebe | 5.53 MiB | 6.01 MiB | 488.12 KiB |
| 93b7728 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| cdf371b | 5.53 MiB | 6.02 MiB | 501.23 KiB |
| 2cb90b9 | 7.86 MiB | 9.54 MiB | 1.69 MiB |
| 6b69699 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| e5ae2a6 | 5.65 MiB | 6.09 MiB | 446.96 KiB |
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
8d6aa54 to
a4e45ae
Compare
Flutter stable now enables Swift Package Manager by default, so the main-channel SPM job duplicates the regular iOS and macOS builds. Drop the job and align the native context expectation with the SPM package source. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
SwiftPM can fail Sentry Cocoa binary target downloads when stale artifact paths already exist on macOS runners. Clear the SwiftPM artifact cache before iOS and macOS example builds resolve packages. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Run the Xcode selection, SwiftPM package rename, and artifact cache cleanup before the shared Flutter test action. Stable Flutter resolves SwiftPM during macOS tests, so the package path must already match the sentry_flutter package identity. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Stable Flutter resolves SwiftPM during cocoa integration tests. Apply the same macOS package rename and SwiftPM artifact cleanup before pub get, pod install, and test execution in the integration workflow. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Stable Flutter now resolves the iOS and macOS integration tests through SwiftPM by default. Remove the explicit pod install from the cocoa test workflow so it does not force the old CocoaPods setup before tests. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
SwiftPM can recreate stale artifact paths during the same macOS runner job. Clear the artifact cache again immediately before the iOS and macOS example builds resolve package dependencies. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Stable Flutter can resolve SwiftPM dependencies during both the shared test action and the later example build. Clear stale SwiftPM binary artifacts immediately before each iOS and macOS resolution path. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Keep SwiftPM artifact cleanup at the package resolution boundaries and remove redundant copies from the main Flutter workflow. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
SwiftPM binary artifact downloads can fail when stale package cache state survives between resolution attempts. Centralize the cache reset and clear both SwiftPM caches and Xcode SourcePackages before Apple package resolves. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
SwiftPM can create a bad binary artifact cache during an iOS or macOS build resolution even after starting from a clean cache. Reuse the cache reset script and retry Apple builds once after a failed resolve. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Remove the composite wrapper around the SwiftPM cache reset script. The workflows now invoke the shared shell script directly at the existing package resolution points. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
a4e45ae to
9e1d11a
Compare
Move the SwiftPM cache reset helper out of GitHub Actions and into the CI scripts directory. Add context for why the cleanup is needed on macOS runners. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c5cf749 | 379.18 ms | 360.60 ms | -18.58 ms |
| 3ddf010 | 431.14 ms | 438.10 ms | 6.96 ms |
| 6e7d494 | 397.35 ms | 378.91 ms | -18.43 ms |
| dbd526b | 504.88 ms | 569.02 ms | 64.15 ms |
| 753d4ac | 426.28 ms | 423.45 ms | -2.83 ms |
| 575ebaa | 478.00 ms | 585.76 ms | 107.76 ms |
| f3771ea | 379.02 ms | 363.91 ms | -15.11 ms |
| c58ce03 | 469.42 ms | 472.40 ms | 2.98 ms |
| 38a22c2 | 418.68 ms | 436.54 ms | 17.86 ms |
| c1e775e | 482.36 ms | 608.98 ms | 126.62 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c5cf749 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 3ddf010 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| 6e7d494 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| dbd526b | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 753d4ac | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 575ebaa | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| f3771ea | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| c58ce03 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 38a22c2 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| c1e775e | 6.54 MiB | 7.70 MiB | 1.17 MiB |
The shared Flutter test action is used by multiple package workflows, so keep the SPM cache workaround in the Flutter workflow that performs the sentry_flutter package rename. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Avoid clearing SwiftPM caches on the successful build path. Keep the cleanup for macOS tests and for the Apple build retry after SwiftPM has actually failed. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Avoid clearing SwiftPM caches before the shared Flutter test step. Keep the cache reset only for the Apple build retry and the separate cocoa integration workflow. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
| flutter build macos || { | ||
| clear_swiftpm_cache | ||
| flutter build macos | ||
| } |
There was a problem hiding this comment.
if it fails, try to clear cache then retry
There was a problem hiding this comment.
Pull request overview
This PR updates the Flutter CI workflows to reflect stable Flutter’s default Swift Package Manager (SwiftPM) behavior for iOS/macOS, removing the now-redundant main-channel-only SPM job and adjusting build/test steps accordingly.
Changes:
- Update iOS native SDK identifier expectation in integration tests from CocoaPods to SwiftPM.
- Update Flutter CI workflows to select Xcode 16.4 on macOS runners, handle SwiftPM cache cleanup, and rename the local plugin directory for macOS SwiftPM identity resolution.
- Remove the dedicated “SPM (main channel)” CI job and stop running explicit
pod installin the Cocoa integration workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/flutter/example/integration_test/integration_test.dart | Align expected native SDK package name with SwiftPM-based Sentry Cocoa integration. |
| .github/workflows/flutter.yml | Fold SwiftPM/Xcode setup into the main Flutter build matrix and remove the separate SPM job. |
| .github/workflows/flutter_test.yml | Update cocoa integration workflow to use SwiftPM cache clearing + correct working directories (incl. macOS rename path) and drop explicit pod install. |
| .github/scripts/clear-swiftpm-cache.sh | Add a helper script to clear SwiftPM/Xcode package caches on macOS runners. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a stable Apple build smoke test with SwiftPM explicitly disabled so CI still validates CocoaPods compatibility while the main Apple jobs use Flutter's SwiftPM defaults. Co-Authored-By: GPT-5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
Align Flutter CI with stable Flutter enabling Swift Package Manager by default for iOS and macOS builds. The dedicated main-channel SPM job is removed, while the regular build and native integration workflows now carry the SwiftPM setup needed on macOS runners.
SwiftPM CI Setup
The iOS and macOS CI paths now select the expected Xcode version, clear SwiftPM and Xcode package caches around package resolution, and rename the local Flutter package for macOS so SwiftPM sees the
sentry_flutterpackage identity.Cocoa Integration Tests
The cocoa integration workflow no longer runs an explicit
pod installbefore Flutter tests. Stable Flutter resolves this path through SwiftPM, and macOS tests run from the renamedpackages/sentry_flutter/exampledirectory.Related PR
The newer Dart analyzer export fix was split out into #3711 so this PR stays scoped to SPM CI changes.