-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* incorporate ImageVersion or build action hash into vcpkg cache keys
- Loading branch information
1 parent
e00568a
commit d87bd47
Showing
2 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ runs: | |
- name: macOS tools | ||
if: runner.os == 'macOS' | ||
shell: bash | ||
run: brew install autoconf autoconf-archive automake pkg-config | ||
run: | | ||
brew install autoconf autoconf-archive automake pkg-config md5sha1sum | ||
- name: simple build | ||
run: echo "preset = ${{ inputs.preset }}" | ||
|
@@ -39,16 +40,26 @@ runs: | |
# get baseline from vcpkg | ||
vcpkgJsonGlob: './vcpkg.json' | ||
|
||
- uses: actions/cache@v4 | ||
if: runner.os != 'Linux' | ||
with: | ||
key: deps-${{ inputs.preset }}-${{ hashFiles('./vcpkg.json') }} | ||
path: ./vcpkg_cache | ||
- name: get vcpkg cache key | ||
id: get_vcpkg_cache_key | ||
shell: bash | ||
env: | ||
DISTRO_LABEL: ${{ format('{0}-{1}', matrix.distro.name, matrix.distro.version) }} | ||
KEY_PREFIX: vcpkg_cache-cmake-${{ inputs.preset }} | ||
run: | | ||
common_key="${KEY_PREFIX}-vcpkg_json_md5=$(md5sum ./vcpkg.json | awk '{ print $1 }')" | ||
if [ "${RUNNER_OS}" != "Linux" ]; then | ||
echo "key=${common_key}-ImageVersion=${ImageVersion}" | tee -a $GITHUB_OUTPUT | ||
else | ||
# ImageVersion is irrelevant since the build action runs in a container | ||
# Express the vcpkg overlays, dockerfile, and entry point that the action will use as a single hash | ||
build_action_hash="$(find ./.github/actions/openziti-tunnel-build-action/gh-release -type f -print | xargs md5sum | awk '{ print $1 }' | sort | md5sum | awk '{ print $1 }')" | ||
echo "key=${common_key}-build_action_md5=${build_action_hash}" | tee -a $GITHUB_OUTPUT | ||
fi | ||
- uses: actions/cache@v4 | ||
if: runner.os == 'Linux' | ||
with: | ||
key: deps=${{ inputs.preset }}-${{ hashFiles('./vcpkg.json', '.github/actions/openziti-tunnel-build-action/gh-release/vcpkg-overlays/**/vcpkg.json') }} | ||
key: ${{ steps.get_vcpkg_cache_key.outputs.key }} | ||
path: ./vcpkg_cache | ||
|
||
- uses: lukka/[email protected] # pin version to avoid failed glibc dependency on ubuntu 20 runners. go back to @latest when ubuntu 22+ is adopted for runner os. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters