Skip to content

Commit

Permalink
Key on library name rather than manifest hash
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Nov 3, 2023
1 parent 8f7d95f commit 73a3bf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .github/actions/prepare-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ inputs:
os:
description: The operating system on which the test is being run
required: true
crypto-dir:
description: The manifest directory for crypto dependencies
crypto:
description: The crypto library being used
required: true
cache-dir:
description: Where to put vcpkg cache
Expand All @@ -14,17 +14,16 @@ inputs:
runs:
using: "composite"
steps:
- name: Capture vcpkg revision and manifest for use in cache key
- name: Capture vcpkg revision for use in cache key
shell: bash
run: |
git -C vcpkg rev-parse HEAD > vcpkg_commit.txt
cp "${{ inputs.crypto-dir }}/vcpkg.json" vcpkg_manifest.txt
- name: Restore cache
uses: actions/cache@v3
with:
path: ${{ inputs.cache-dir }}
key: v01-vcpkg-${{ inputs.os }}-${{ hashFiles('vcpkg_commit.txt', 'vcpkg_manifest.txt') }}
key: v01-vcpkg-${{ inputs.os }}-${{ inputs.crypto }}-${{ hashFiles('vcpkg_commit.txt', 'alternatives/*/vcpkg.json') }}
restore-keys: |
v01-vcpkg-${{ inputs.os }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- uses: ./.github/actions/prepare-build
with:
os: ${{ matrix.os }}
crypto-dir: ${{ env.CRYPTO_DIR }}
crypto: ${{ matrix.crypto }}
cache-dir: ${{ github.workspace }}/vcpkg_cache

- name: Build
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: ./.github/actions/prepare-build
with:
os: ubuntu-latest
crypto-dir: ${{ env.CRYPTO_DIR }}
crypto-dir: openssl_1.1
cache-dir: ${{ github.workspace }}/vcpkg_cache

- name: Build
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- uses: ./.github/actions/prepare-build
with:
os: ubuntu-latest
crypto-dir: ${{ env.CRYPTO_DIR }}
crypto: matrix.crypto
cache-dir: ${{ github.workspace }}/vcpkg_cache

- name: Build with clang-tidy
Expand Down

0 comments on commit 73a3bf3

Please sign in to comment.