Skip to content

CI: only save dependency caches on master, restore on PRs#10731

Merged
dgarske merged 5 commits into
wolfSSL:masterfrom
julek-wolfssl:ci-cache-save-on-master
Jun 18, 2026
Merged

CI: only save dependency caches on master, restore on PRs#10731
dgarske merged 5 commits into
wolfSSL:masterfrom
julek-wolfssl:ci-cache-save-on-master

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

GitHub Actions caches are branch-scoped: an entry written by a pull_request
run lives under refs/pull/<N>/merge and is invisible to other PRs. The
haproxy, mbedtls, nss, ntp, threadx and hostap-vm workflows used combined
actions/cache with fixed keys, so every PR re-saved its own copy of the same
dependency, yielding one duplicate cache entry per PR.

CI: only save dependency caches on master, restore on PRs

  • Split each into actions/cache/restore (always) plus actions/cache/save
    gated to refs/heads/master, and add a daily schedule so a master run
    reseeds the single shared entry that all PRs restore.
  • mbedtls/nss save in their build job only; the test jobs restore-only.
  • Disable the setup-msys2 package cache: the action only toggles caching
    on/off and cannot save on master while restoring on PRs.

CI: factor threadx NetXDuo version into NETXDUO_REF env var

  • The v6.4.3_rel version was repeated in the cache path, cache key, download
    URL and extract command. Define it once as a workflow-level env var and
    reference it everywhere.

GitHub Actions caches are branch-scoped: an entry written by a
pull_request run lives under refs/pull/<N>/merge and is invisible to
other PRs. The haproxy, mbedtls, nss, ntp, threadx and hostap-vm
workflows used combined actions/cache with fixed keys, so every PR
re-saved its own copy of the same dependency, yielding one duplicate
cache entry per PR.

Split each into actions/cache/restore (always) plus actions/cache/save
gated to refs/heads/master, and add a daily schedule so a master run
reseeds the single shared entry that all PRs restore. mbedtls/nss save
in their build job only; the test jobs restore-only.

Disable the setup-msys2 package cache: the action only toggles caching
on/off and cannot save on master while restoring on PRs.
The v6.4.3_rel version was repeated in the cache path, cache key,
download URL and extract command. Define it once as a workflow-level
env var and reference it everywhere.
Copilot AI review requested due to automatic review settings June 18, 2026 12:37
@julek-wolfssl julek-wolfssl self-assigned this Jun 18, 2026

Copilot AI 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.

Pull request overview

This PR updates several CI workflows to avoid creating duplicate dependency caches on every pull request by switching from actions/cache to an always-restore + default-branch-only save pattern, and adds scheduled runs to keep the shared cache warm. It also deduplicates the ThreadX NetXDuo version string into a single workflow-level environment variable.

Changes:

  • Split dependency caching into actions/cache/restore@v5 (always) and actions/cache/save@v5 (only on refs/heads/master), with a daily schedule trigger to reseed shared caches.
  • Adjust mbedtls/nss so only the build job owns cache saving; test jobs are restore-only (with existing cache-miss fallbacks).
  • Factor ThreadX NetXDuo version into NETXDUO_REF and disable msys2/setup-msys2 caching.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/threadx.yml Adds scheduled seeding, splits NetXDuo cache restore/save, and factors version into NETXDUO_REF.
.github/workflows/ntp.yml Adds scheduled seeding and splits NTP tarball caching into restore-only + master-only save.
.github/workflows/nss.yml Adds scheduled seeding and switches NSS dist/ caching to restore-only + master-only save.
.github/workflows/msys2.yml Disables msys2/setup-msys2 caching since it can’t be restricted to master-only saves.
.github/workflows/mbedtls.yml Adds scheduled seeding and switches mbedtls caching to restore-only + master-only save.
.github/workflows/hostap-vm.yml Adds scheduled seeding and splits hostap + kernel caches into restore-only + master-only save.
.github/workflows/haproxy.yml Adds scheduled seeding and switches haproxy checkout caching to restore-only + master-only save.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/mbedtls.yml
Comment thread .github/workflows/nss.yml
With the cache save restricted to master, a cold-cache PR or release
run can no longer restore in the test job what the build job just built
(the per-PR cache scope is gone), so mbedtls/nss were compiled twice.

Upload the build as an artifact on a cache miss and download it in the
test job instead of recompiling, matching the handoff hostap-vm already
uses. master still restores from the shared cache, so it never uses the
artifact.
Add the same draft-PR guard the other workflows use so the job does
not run while a pull request is still a draft.
@julek-wolfssl julek-wolfssl marked this pull request as ready for review June 18, 2026 13:44
@github-actions

Copy link
Copy Markdown

retest this please

The draft guard skips the job on draft PRs, but the pull_request
trigger used the default types (no ready_for_review), so marking a
draft ready did not re-run the job and it stayed skipped. Add the
standard types, matching the other workflows, so it re-runs when the
PR becomes ready.

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@dgarske

dgarske commented Jun 18, 2026

Copy link
Copy Markdown
Member

Jenkins restest this please: "ERROR: Build 'PRB-generic-config-parser' failed with result: FAILURE" -> "DTLS" -> "FAIL scripts/unit.test (exit status: 1)"

@dgarske dgarske merged commit c2a8f77 into wolfSSL:master Jun 18, 2026
293 of 295 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants