Skip to content

Commit

Permalink
Update to use vcpkg GHA caching support (#4015)
Browse files Browse the repository at this point in the history
Update vcpkg to use the newly released GitHub Actions Cache support.

---
TYPE: IMPROVEMENT
DESC: Update vcpkg to use GitHub Actions Cache
  • Loading branch information
davisp authored Apr 3, 2023
1 parent a333b75 commit 3f38ef1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/ci-linux_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ env:
CXX: ${{ inputs.matrix_compiler_cxx }}
CC: ${{ inputs.matrix_compiler_cc }}
bootstrap_args: ${{ inputs.bootstrap_args }}
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'

jobs:
build:
Expand All @@ -59,24 +60,20 @@ jobs:
submodules: true
fetch-depth: 0

- name: Generate vcpkg cache key data
run: |
echo "${CC}" > $GITHUB_WORKSPACE/vcpkg-cache-key.data
echo "${CXX}" >> $GITHUB_WORKSPACE/vcpkg-cache-key.data
echo "${bootstrap_args}" >> $GITHUB_WORKSPACE/vcpkg-cache-key.data
shell: bash

- name: Create vcpkg cache key
id: vcpkg_cache_key
run: echo "value=${{ hashFiles('vcpkg-cache-key.data') }}" >> $GITHUB_OUTPUT
# Configure required environment variables for vcpkg to use
# GitHub's Action Cache
- uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Restore artifacts, or setup vcpkg for building artifacts
uses: lukka/run-vcpkg@v10
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgJsonGlob: 'vcpkg.json'
vcpkgDirectory: '${{ github.workspace }}/external/vcpkg'
prependedCacheKey: 'tiledb-${{steps.vcpkg_cache_key.outputs.value}}'

- name: Prints output of run-vcpkg's action.
run: |
Expand Down
2 changes: 1 addition & 1 deletion external/vcpkg
Submodule vcpkg updated 3842 files

0 comments on commit 3f38ef1

Please sign in to comment.