Repository navigation
ci: share the Swift package cache and move actions to Node 24 - #605
Merged
Merged
Conversation
ios.yml and release.yml cache Swift packages under the same key but listed different paths. A cache entry's version is a hash of its path list, so the two were separate caches: no pull request ever restored the entry release.yml saved on main. Each one missed, rebuilt the packages cold, and stored its own ~880 MB copy under that same key; the cache list shows one per open pull request beside main's. Give both the same three paths. release.yml needs every one of them: Flutter's step clones into build/ios/SourcePackages and the xcodebuild archive after it clones into DerivedData. ios.yml writes only the first two and lists the third so the lists match.
Runs still warned that cache@v4, upload-artifact@v4, download-artifact@v4, paths-filter@v3 and github-script@v7 target Node 20 and are being forced onto Node 24. Take the first major of each that ships Node 24: cache v5 (what ios.yml and android.yml already use), upload-artifact v6, download-artifact v7, paths-filter v4 and github-script v8. None of those majors changes an input used here. download-artifact v5 changed where an artifact fetched by id is extracted; release.yml fetches them all with merge-multiple, which that change does not touch.
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). |
lowrt
approved these changes
Oct 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
讓 PR 的 iOS 建置能還原 main 存下的 Swift 套件快取,並把剩下仍跑在 Node 20 的 action 升到第一個支援 Node 24 的 major。所有 workflow 的行為都沒變。
d8096522ci: let pull requests restore the Swift package cache main saves(ios.yml、release.yml)兩個 workflow 的 SPM 快取用同一個 key,但列的路徑不同。actions/cache 的快取版本是用路徑清單算出來的 hash,路徑不同就是兩份不同的快取(actions/cache README:「
build-linuxwill create two different caches as thepathsare different」)。所以 PR 永遠還原不到 release.yml 在 main 存的那份。每個 PR 都從零重建套件,再用同一個 key 另存一份自己的。目前的 cache 清單就是這樣:
macOS-spm-3827c54c…refs/heads/mainmacOS-spm-3827c54c…refs/pull/604/mergemacOS-spm-3827c54c…refs/pull/588/merge修法是兩邊改成列同樣三個路徑。release.yml 三個都會用到:Flutter 那一步 clone 到
build/ios/SourcePackages,後面直接呼叫的xcodebuild archive沒有帶-clonedSourcePackagesDirPath,所以 clone 到 DerivedData。ios.yml 只會寫入前兩個,第三個列出來只是為了讓兩邊清單一致。原本 release.yml 沒有快取
build/ios/SourcePackages,這次補上後,release 的 Flutter 那一步也能用到快取。f8cdf49cci: move the remaining actions onto their Node 24 majors(android.yml、ios.yml、release.yml、review.yml)最近的 run 都有「targets Node.js 20 but is being forced to run on Node.js 24」的警告。各升到第一個支援 Node 24 的 major,用到的 input 都沒有受到破壞性變更影響:
merge-multiple,不受影響require('@actions/github')失效,review.yml 的 script 沒有用requiresetup-java@v5和jdx/mise-action@v4本來就是 Node 24,沒有動。相關 issue
沒有對應的 issue。
怎麼驗
actionlint 1.7.12 -shellcheck=跑過全部 workflow,沒有警告。path、key、restore-keys逐行比對過,完全相同。Cache Swift Packages應該顯示從 main 的 key 還原,而且不會再另存一份 PR 自己的快取。檢查清單
tool/check/commits.sh origin/main..HEAD通過mise exec -- flutter analyze與mise exec -- flutter test通過(只改 workflow,交給 CI)AppLocalizations(沒有新字串)