-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Save/Restore seperately in MacOS/Windows caching workflows. #11199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 217
🌐 Web query:
msys2/setup-msys2 v2 cache true restore-only-save-cache branch PR documentation💡 Result:
The
msys2/setup-msys2action does not provide a specificrestore-only-save-cacheparameter or feature. The officialcacheoption accepts a boolean value (trueorfalse) [1][2][3], wheretrue(the default) automatically handles both restoring and saving the package cache during workflow runs [1][4][5]. Research into the action's development history reveals the following context regarding caching behavior: 1. Automatic Management: The action was designed to manage caching automatically to avoid complexity for users [6]. It implements internal logic to determine when to restore, prune, and save caches based on environment configuration and package changes [4][7]. 2. Alternative Approaches: There is no documented native parameter to restrict the action to "restore-only" behavior. Previous discussions regarding granular cache control (such as separating restore and save phases) have generally been addressed by the maintainers through the current automated system [4][8][6]. 3. Current Implementation: The action uses GitHub Actions caching to store and retrieve packages [7][3]. If you require specific cache behavior not supported by the action, users typically manage this by settingcache: falseand implementing custom cache steps using the officialactions/cacheaction [1][8]. If you are looking for this feature due to issues with cache size or race conditions, note that the action includes built-in safeguards, such as pruning caches before saving and avoiding redundant saves if the cache has not changed [4][7].Citations:
🌐 Web query:
actions/setup-python v6 cache pip restore-default branch PR documentation💡 Result:
The actions/setup-python action (v6+) provides built-in dependency caching for pip, pipenv, and poetry [1][2]. By default, this action uses the hash of your dependency file (e.g., requirements.txt or pyproject.toml) to create a unique cache key [1][2]. When a workflow runs, the action searches for a cache match based on this key [3]. If an exact match is not found, it can fall back to partial matches using restore keys if they were configured [3][4]. Regarding your specific interest in "restore-default" branch behavior or PR-related caching: 1. Cache Scope and PRs: Caches are scoped by the branch and the repository [3]. For pull requests, the action attempts to restore the cache from the current branch. If no cache is found for the feature branch, GitHub Actions automatically falls back to searching for a cache from the base branch (e.g., main or master) [3]. This ensures that PRs can benefit from existing dependencies installed on the default branch without needing to build from scratch. 2. Read-Only Cache Mode: To prevent issues like "cache poisoning" (where an untrusted PR might upload malicious packages to the cache), you can use the cache-write input [5]. By setting
cache-writeto false (e.g.,cache-write: ${{ github.event_name != 'pull_request' }}), you can allow PRs to restore existing caches in read-only mode while preventing them from writing new cache entries [5]. 3. Advanced Configuration: You can usecache-dependency-pathif you need to point to specific dependency files, including multiple files or wildcard patterns, especially if they are located outside the workspace root [1][6][7]. In summary, the "restore" logic for branches happens automatically: the runner looks for a cache on the current branch first, and if that fails, it looks for one on the parent/default branch [3]. You do not need to manually configure "restore-default" branch logic, as this is standard behavior of the underlying GitHub Actions cache service [3].Citations:
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 10184
Gate the built-in dependency caches too.
SAVE_CACHEonly skips the PlatformIO save step, but this workflow still allowsmsys2/setup-msys2@v2withcache: trueandactions/setup-python@v6withcache: pipto save caches on PR/merge_group runs. That contradicts the comment policy; usecache: falseor explicitactions/cache/restore+ gatedactions/cache/savesteps for both package managers.🤖 Prompt for AI Agents