ci: revise cache key so that a bump in any submodule will cause a cache miss

This commit is contained in:
Michael Bradley, Jr 2021-01-05 13:59:50 -06:00 committed by Michael Bradley
parent d1ed963f50
commit 99e9ed1734
1 changed files with 11 additions and 1 deletions

View File

@ -45,6 +45,11 @@ jobs:
steps:
- name: Install awk (gawk) and coreutils via Homebrew
if: matrix.platform.os == 'macos'
run: |
brew install coreutils gawk
- name: Link Homebrew OpenSSL 1.1 to /usr/local/opt/openssl
if: matrix.platform.os == 'macos'
run: |
@ -67,10 +72,15 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Calculate cache key from submodules tree
id: calc-cache-key
run: |
echo "::set-output name=hash::$(git submodule foreach --quiet --recursive 'git rev-parse $(git rev-parse --abbrev-ref HEAD)' | sha1sum | awk '{print $1}')"
- uses: actions/cache@v2
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ matrix.platform.os }}-${{ env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}
key: ${{ matrix.platform.os }}-${{ steps.calc-cache-key.outputs.hash }}
- name: Install and build dependencies
run: |