Skip to content

ci: build on merges to master so the vcpkg cache is actually shared - #722

Merged
ddehilster merged 1 commit into
masterfrom
ci/seed-cache-on-master
Aug 25, 2026
Merged

ci: build on merges to master so the vcpkg cache is actually shared#722
ddehilster merged 1 commit into
masterfrom
ci/seed-cache-on-master

Conversation

@ddehilster

Copy link
Copy Markdown
Member

The binary caching I added in #721 was only half working, and I'd rather say so than leave it looking done.

What was wrong

GitHub Actions lets a run read caches from its own ref and from the default branch — nothing else. These workflows trigger only on pull_request and push: tags, so nothing ever ran on master. No shared entry was ever seeded, so every PR missed, rebuilt ICU from source, and saved a private copy no other PR could read.

Verified against the API after v3.8.9 — all ten entries under PR refs, none on refs/heads/master:

refs/pull/720/merge :: vcpkg-Windows-X64-... 73.0 MB
refs/pull/721/merge :: vcpkg-Windows-X64-... 73.0 MB
refs/pull/720/merge :: vcpkg-macOS-ARM64-... 82.3 MB
...

So #721 paid the cost of caching while delivering the benefit only within a single PR (second and later pushes). The /MP half of that PR works fine and is unaffected — the Windows compile step went 3m40s → 1m41s and stays there.

The fix

Build on push to master. That seeds the entry PR runs then hit.

The trade, stated plainly: one extra build per merge, against removing a ~10-minute ICU rebuild (Windows; ~4 min on Linux) from every job on every PR run. It also means something finally verifies the merge result, which nothing did before.

Also

Skips the cache steps on the ubuntu-20.04 matrix entry. That one builds inside Docker and skips the non-Docker vcpkg step, so it was caching an empty directory — the 200-byte entry in the listing above.

Expectations

The first master run after this merges is still a miss. The saving starts on the PR after that, so judge it there rather than on the merge itself.

🤖 Generated with Claude Code

The binary caching added in #721 was only half working. GitHub Actions
lets a run read caches from its own ref and from the DEFAULT branch, and
these workflows trigger only on pull_request and push:tags -- so nothing
ever ran on master, no shared entry was ever seeded, and every PR missed,
rebuilt ICU, and saved a private copy no other PR could read.
Verified against the API after v3.8.9: all ten cache entries sat under
refs/pull/720/merge and refs/pull/721/merge, none on refs/heads/master.
Building on push to master seeds the entry that PR runs then hit. Cost is
one extra build per merge, against ~10 min of ICU rebuild (Windows; ~4 min
on Linux) per job on every PR run. It also means something finally
verifies the merge result, which nothing did before.
Also skip the cache steps on the ubuntu-20.04 matrix entry: it builds
inside Docker and skips the non-Docker vcpkg step, so it was caching an
empty directory (a 200-byte entry).
The first master run after this merges is still a miss; the saving starts
on the PR after that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ddehilster
ddehilster merged commit 2930aef into masterAug 25, 2026
7 checks passed
Sign up for freeto 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.

1 participant

@ddehilster