Skip to content

Actions: Add caching for MacOS and Windows build workflows - #11194

Merged
vidplace7 merged 1 commit into
developfrom
cacheduino
Jul 24, 2026
Merged

Actions: Add caching for MacOS and Windows build workflows#11194
vidplace7 merged 1 commit into
developfrom
cacheduino

Conversation

@vidplace7

@vidplace7 vidplace7 commented Jul 24, 2026

Copy link
Copy Markdown
Member

This pull request introduces improvements to the CI build workflows for both MacOS and Windows, mainly focused on speeding up builds and reducing redundant downloads by adding caching for Homebrew, PlatformIO, and pip dependencies. These changes help make the builds more reliable and efficient.

Build caching improvements:

  • MacOS workflow (.github/workflows/build_macos_bin.yml):

    • Added caching for Homebrew downloads using the runner image version, which will reduce repeated downloads and speed up dependency installation.
    • Added caching for PlatformIO packages, using a cache key based on the MacOS version and relevant config files, to avoid re-downloading packages on every build.
  • Windows workflow (.github/workflows/build_windows_bin.yml):

    • Enabled MSYS2 package manager caching, which helps avoid redundant downloads of MSYS2 packages.
    • Enabled pip caching in the Python setup step, reducing time spent reinstalling Python packages.
    • Added caching for PlatformIO packages, using a cache key based on the Windows version and config files, similar to the MacOS workflow.

Summary by CodeRabbit

  • Performance

    • Added build-time caching to both macOS and Windows workflows to reduce repeated downloads and speed up build runs.
    • Cached PlatformIO package downloads based on OS version and configuration hashes.
  • Reliability

    • macOS builds now fail the workflow on native build errors instead of continuing.
  • Maintenance

    • Streamlined macOS dependency installation by avoiding automatic Homebrew updates/cleanup during the workflow.
    • Updated dependency list to include the required jsoncpp package.

@vidplace7
vidplace7 requested a review from thebentern July 24, 2026 15:05
@vidplace7 vidplace7 added the github_actions Pull requests that update GitHub Actions code label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3117b56a-5d4d-4bef-8f51-349647e0c7f4

📥 Commits

Reviewing files that changed from the base of the PR and between cfa2e91 and d9e7f33.

📒 Files selected for processing (2)
  • .github/workflows/build_macos_bin.yml
  • .github/workflows/build_windows_bin.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/build_macos_bin.yml
  • .github/workflows/build_windows_bin.yml

📝 Walkthrough

Walkthrough

The macOS and Windows native build workflows now cache dependency artifacts. The macOS workflow skips Homebrew updates and cleanup, adds jsoncpp, and makes native build failures fail the workflow.

Changes

Native build workflows

Layer / File(s) Summary
macOS dependency caching and build flow
.github/workflows/build_macos_bin.yml
Caches Homebrew downloads and PlatformIO packages, avoids Homebrew auto-updates and cleanup, adds jsoncpp, preserves release version generation, and propagates native build failures.
Windows dependency caching
.github/workflows/build_windows_bin.yml
Enables MSYS2 and pip caching and adds keyed caching for PlatformIO packages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: thebentern

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding caching to macOS and Windows build workflows.
Description check ✅ Passed The description covers the main workflow changes, but it omits the template’s testing/attestation section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cacheduino

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
.github/workflows/build_macos_bin.yml (1)

48-55: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Align both PlatformIO cache keys with all included configuration files.

Both keys hash only two files even though platformio.ini imports additional variant and platform configuration files. Hash the complete extra_configs input set in both workflows so dependency changes create a new cache; existing cache contents cannot be modified in place. (docs.github.com)

  • .github/workflows/build_macos_bin.yml#L48-L55: include all native dependency configuration files in the pio-macos key.
  • .github/workflows/build_windows_bin.yml#L74-L81: apply the same complete configuration hash to the pio-windows key.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build_macos_bin.yml around lines 48 - 55, Update the
PlatformIO cache key in .github/workflows/build_macos_bin.yml lines 48-55 to
hash every native dependency configuration file included by extra_configs, and
apply the same complete configuration hash to the pio-windows key in
.github/workflows/build_windows_bin.yml lines 74-81. Keep the corresponding
restore-key prefixes unchanged so configuration changes produce distinct caches
in both workflows.

Source: MCP tools

.github/workflows/build_windows_bin.yml (1)

55-55: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Tie pip caching to the PlatformIO dependency declaration.

setup-python creates pip cache keys from discovered dependency files or cache-dependency-path, while this step installs unpinned platformio inline. Add a pinned requirements.txt/pyproject.toml for platformio, set cache-dependency-path to that file, and install from the same file so the cache key reflects the package being installed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build_windows_bin.yml at line 55, Update the setup-python
step using cache: "pip" to declare a pinned PlatformIO dependency in a
requirements.txt or pyproject.toml file, set cache-dependency-path to that file,
and change the PlatformIO installation to read from the same declaration so
cache invalidation tracks the installed version.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/build_macos_bin.yml:
- Around line 48-55: Update the PlatformIO cache key in
.github/workflows/build_macos_bin.yml lines 48-55 to hash every native
dependency configuration file included by extra_configs, and apply the same
complete configuration hash to the pio-windows key in
.github/workflows/build_windows_bin.yml lines 74-81. Keep the corresponding
restore-key prefixes unchanged so configuration changes produce distinct caches
in both workflows.

In @.github/workflows/build_windows_bin.yml:
- Line 55: Update the setup-python step using cache: "pip" to declare a pinned
PlatformIO dependency in a requirements.txt or pyproject.toml file, set
cache-dependency-path to that file, and change the PlatformIO installation to
read from the same declaration so cache invalidation tracks the installed
version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ae4366c-7e9f-4e64-9f22-47718552576e

📥 Commits

Reviewing files that changed from the base of the PR and between 7754068 and 6930d7c.

📒 Files selected for processing (2)
  • .github/workflows/build_macos_bin.yml
  • .github/workflows/build_windows_bin.yml

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@vidplace7
vidplace7 merged commit 0ef375d into develop Jul 24, 2026
11 of 86 checks passed
@vidplace7
vidplace7 deleted the cacheduino branch July 24, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant