Skip to content

Commit

Permalink
Added caching of vcpkg artifacts (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer authored Jan 5, 2025
1 parent 79dce1a commit 53e6704
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
runs-on: ${{ inputs.os }}-latest

steps:
- name: Export variables for vcpkg
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v4

- uses: ammaraskar/msvc-problem-matcher@master # Report MSVC compiler errors
Expand All @@ -38,6 +45,8 @@ jobs:
- uses: lukka/run-vcpkg@v11 # Set up vcpkg and install dependencies
with:
runVcpkgInstall: true
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

- name: Set preset name
id: preset
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ jobs:
- "9125:9125/tcp"

steps:
- name: Export variables for vcpkg
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v4

- uses: lukka/get-cmake@latest

- uses: lukka/run-vcpkg@v11
with:
runVcpkgInstall: true
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

- run: cmake --preset linux-x64-debug
- run: cmake --build --preset linux-x64-debug --target integration-test
- run: out/build/linux-x64-debug/integration-test statsd+tcp://localhost:9125
Expand Down

0 comments on commit 53e6704

Please sign in to comment.