summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2021-06-03 15:26:52 -0700
committerGitHub <noreply@github.com>2021-06-03 15:26:52 -0700
commit5b0d429d1ac4288d615afccfe1eeb16e68141488 (patch)
treee9b20e864e0722655fb644910c8d4906d1d8d477 /.github
parentb61070cf03c30abe3ba5956596b88464053ff358 (diff)
[GitHub Actions] Make caching of dependencies depend on image version (#6677)
Our Clang builds started to fail to link when the environment changed. This commit changes our CI to only use cached dependencies if the build environment has not changed.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml14
1 files changed, 13 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b9ec42af3..95c6c035c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -77,6 +77,11 @@ jobs:
sudo cmake .
sudo cmake --build . --target install
cd -
+ # Make ImageVersion accessible as env.image_version. Environment
+ # variables of the runner are not automatically imported:
+ #
+ # https://github.com/actions/runner/blob/master/docs/adrs/0278-env-context.md#dont-populate-the-env-context-with-environment-variables-from-runner-machine
+ echo "image_version=$ImageVersion" >> $GITHUB_ENV
echo "/usr/lib/ccache" >> $GITHUB_PATH
# Note: macOS comes with a libedit; it does not need to brew-installed
@@ -93,6 +98,11 @@ jobs:
python3 -m pip install toml
python3 -m pip install setuptools
python3 -m pip install pexpect
+ # Make ImageVersion accessible as env.image_version. Environment
+ # variables of the runner are not automatically imported:
+ #
+ # https://github.com/actions/runner/blob/master/docs/adrs/0278-env-context.md#dont-populate-the-env-context-with-environment-variables-from-runner-machine
+ echo "image_version=$ImageVersion" >> $GITHUB_ENV
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Install Python Dependencies
@@ -170,7 +180,9 @@ jobs:
uses: actions/cache@v2
with:
path: build/deps
- key: cvc5-deps-${{ runner.os }}-${{ matrix.cache-key }}-${{ hashFiles('cmake/Find**', 'cmake/deps-helper.cmake') }}-${{ hashFiles('.github/workflows/ci.yml') }}
+ # The cache depends on the image version to make sure that we do not
+ # restore the dependencies if the build environment has changed.
+ key: cvc5-deps-${{ runner.os }}-${{ env.image_version }}-${{ matrix.cache-key }}-${{ hashFiles('cmake/Find**', 'cmake/deps-helper.cmake') }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Configure
run: |
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback