Skip to content

feat: add setup-vcpkg composite action with binary caching#13

Merged
CameronBrooks11 merged 2 commits into
mainfrom
feat/setup-vcpkg-action
May 26, 2026
Merged

feat: add setup-vcpkg composite action with binary caching#13
CameronBrooks11 merged 2 commits into
mainfrom
feat/setup-vcpkg-action

Conversation

@CameronBrooks11
Copy link
Copy Markdown
Member

Summary

Adds a shared composite action at .github/actions/setup-vcpkg/action.yml that replaces lukka/run-vcpkg across the org.

Why

lukka/run-vcpkg@v11 sets VCPKG_BINARY_SOURCES=clear;x-gha,readwrite, but vcpkg removed the x-gha provider in April 2025 (microsoft/vcpkg-tool#1662). The clear also disables the default filesystem cache. Result: every CI run compiles all vcpkg packages from source — gRPC alone takes 33–46 minutes.

This affects all 5 C++ repos in the org (provider-sim: 2h50m, anolis: 2h, fluxgraph: 50m, bread/ezo: 22m).

What this action does

  1. Clones vcpkg at a pinned commit (shallow, filter=blob:none)
  2. Bootstraps (bootstrap-vcpkg.sh on Linux, .bat on Windows)
  3. Sets VCPKG_ROOT and VCPKG_BINARY_SOURCES=clear;files,...,readwrite
  4. Restores/saves binary cache via actions/cache@v4

Usage (for consuming repos)

- name: Setup vcpkg
  uses: anolishq/.github/.github/actions/setup-vcpkg@main
  with:
    vcpkg-commit: ${{ env.VCPKG_COMMIT }}
    triplet: x64-linux-static

Testing

Self-test job added: installs yaml-cpp on both Linux and Windows, verifies binary package appears in cache directory.

Rollout plan

  1. This PR (Phase 0) — validate action works
  2. Phase 1: Apply to anolis-provider-bread (simplest repo)
  3. Phase 2: Roll out to ezo → fluxgraph → anolis → provider-sim

References

Replaces lukka/run-vcpkg whose x-gha binary cache provider was removed
from vcpkg in April 2025. This action:

- Clones and bootstraps vcpkg at a pinned commit
- Configures VCPKG_BINARY_SOURCES with filesystem cache
- Persists binary cache via actions/cache@v4
- Supports Linux and Windows

Includes self-test job that validates the action on both platforms
with a yaml-cpp smoke install.

Refs: microsoft/vcpkg#45073, lukka/run-vcpkg#251
x64-linux-static is a custom triplet defined in consuming repos' triplets/
directories. The .github repo doesn't have it. Use built-in x64-linux for
the smoke test — the triplet input is only for cache key partitioning.
@CameronBrooks11 CameronBrooks11 merged commit 64d6585 into main May 26, 2026
5 checks passed
@CameronBrooks11 CameronBrooks11 deleted the feat/setup-vcpkg-action branch May 26, 2026 01:52
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.

1 participant