Skip to content

Actions: Add caching for PlatformIO in native tests workflow - #11309

Merged
vidplace7 merged 1 commit into
developfrom
cache-tests
Jul 31, 2026
Merged

Actions: Add caching for PlatformIO in native tests workflow#11309
vidplace7 merged 1 commit into
developfrom
cache-tests

Conversation

@vidplace7

@vidplace7 vidplace7 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Add caching for PlatformIO in native tests workflow. Also switch to arm64 runners for the tests themelves. In my experience so far, they are faster (and these jobs are heavyy)

Summary by CodeRabbit

  • Tests
    • Updated native and simulator test environments to run on newer Ubuntu 24.04 ARM runners.
    • Improved cache restoration and saving to speed up test workflows.
    • Updated test report generation to run unless the workflow is cancelled.

Also switch to arm64 runners for the tests themelves. In my experience so far, they are faster (and these jobs are heavyy)
@vidplace7
vidplace7 requested a review from NomDeTom July 31, 2026 16:49
@vidplace7 vidplace7 added the github_actions Pull requests that update GitHub Actions code label Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The native test workflow updates runner images, adds conditional PlatformIO cache restore and save steps, and changes report generation to skip only cancelled workflows.

Changes

Native CI workflow

Layer / File(s) Summary
Cache and runner updates
.github/workflows/test_native.yml
The workflow restores PlatformIO caches for simulator and PlatformIO tests. It saves caches only for default-branch pushes. The suite-count and test jobs use updated runners.
Report generation condition
.github/workflows/test_native.yml
Report generation runs unless the workflow is cancelled.

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

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: nomdetom, caveman99

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding PlatformIO caching to the native tests workflow.
Description check ✅ Passed The description clearly summarizes caching and ARM64 runner changes, but it omits the template’s testing attestations.
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 cache-tests

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 (1)
.github/workflows/test_native.yml (1)

76-95: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Qualify both PlatformIO cache families by runner.arch.

The workflow now runs native tests on ARM64, but both cache key families remain architecture-neutral. GitHub cache versioning does not isolate CPU architecture, while PlatformIO caches downloaded packages that can be host-specific. Add ${{ runner.arch }} to the exact keys and restore prefixes. GitHub exposes runner.arch for this purpose. (docs.github.com)

  • .github/workflows/test_native.yml#L76-L95: qualify pio-simulator-tests-*.
  • .github/workflows/test_native.yml#L181-L201: qualify pio-coverage-tests-*.
-          key: pio-simulator-tests-${{ hashFiles('platformio.ini', 'variants/native/portduino.ini', 'variants/native/portduino/platformio.ini') }}
+          key: pio-simulator-tests-${{ runner.arch }}-${{ hashFiles('platformio.ini', 'variants/native/portduino.ini', 'variants/native/portduino/platformio.ini') }}
...
-            pio-simulator-tests-
+            pio-simulator-tests-${{ runner.arch }}-

Apply the same change to the pio-coverage-tests-* keys.

🤖 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/test_native.yml around lines 76 - 95, Qualify both
PlatformIO cache key families with runner.arch to prevent cross-architecture
cache reuse: update the pio-simulator-tests keys and restore prefix in
.github/workflows/test_native.yml lines 76-95, and apply the same change to the
pio-coverage-tests keys and restore prefix in lines 181-201.
🤖 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/test_native.yml:
- Around line 76-95: Qualify both PlatformIO cache key families with runner.arch
to prevent cross-architecture cache reuse: update the pio-simulator-tests keys
and restore prefix in .github/workflows/test_native.yml lines 76-95, and apply
the same change to the pio-coverage-tests keys and restore prefix in lines
181-201.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 43572865-ee69-4f4e-9567-7c0e8e27d177

📥 Commits

Reviewing files that changed from the base of the PR and between 76f4340 and 2baf4ee.

📒 Files selected for processing (1)
  • .github/workflows/test_native.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 enabled auto-merge July 31, 2026 17:14
@vidplace7
vidplace7 added this pull request to the merge queue Jul 31, 2026
Merged via the queue into develop with commit 44dbcaa Jul 31, 2026
55 of 56 checks passed
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