Skip to content

ci: add actions/cache for Linux CI vcpkg installed packages#17

Merged
deku2026 merged 3 commits into
mainfrom
ci/linux-vcpkg-cache
Mar 10, 2026
Merged

ci: add actions/cache for Linux CI vcpkg installed packages#17
deku2026 merged 3 commits into
mainfrom
ci/linux-vcpkg-cache

Conversation

@deku2026
Copy link
Copy Markdown

Summary

Same fix as ArcForgesLabs/ArcVideo#15 — adds GitHub Actions cache for Linux CI vcpkg packages.

Changes

  • Add actions/cache@v5 to cache /tmp/vcpkg/installed across self-hosted runner instances
  • Skip base package install on cache hit (matches Windows CI pattern)
  • Replace local /cache/vcpkg binary cache with x-gha binary caching
  • Add actions/github-script to export cache URL/token for vcpkg binary caching

Problem

When the CI job lands on a different self-hosted runner instance, /tmp/vcpkg is empty and all packages (openexr, imath, ffmpeg) are rebuilt from source. With actions/cache, the installed packages are stored in GitHub's cloud cache and restored regardless of which runner picks up the job.

- Add actions/cache@v5 to cache /tmp/vcpkg/installed across runner instances
- Skip base package install on cache hit (like Windows CI)
- Replace local /cache/vcpkg binary cache with x-gha binary caching
- Fixes full vcpkg rebuilds when landing on a different self-hosted runner

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 11:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds GitHub Actions cloud caching for vcpkg installed packages in the Linux CI pipeline, mirroring the pattern already in place for Windows CI. Previously, the Linux job relied on a local directory (/cache/vcpkg) on the self-hosted runner, which is unavailable when the job lands on a different runner instance, forcing a full rebuild of openexr, imath, and ffmpeg from source.

Changes:

  • Remove the local /cache/vcpkg binary cache directory in favour of GitHub Actions cloud caching via actions/cache@v5 scoped to /tmp/vcpkg/installed
  • Add a actions/github-script@v8 step to export ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN for the self-hosted runner (required for it to access the GHA cache API)
  • Skip vcpkg install on cache hit and scope VCPKG_BINARY_SOURCES=clear;x-gha,readwrite to the install step only

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

Comment thread .github/workflows/linux-ci.yml
@deku2026 deku2026 merged commit 0c31759 into main Mar 10, 2026
4 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.

2 participants