diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da30ca64..d278ad17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -256,8 +256,8 @@ jobs: COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - name: Prepare for cache - if: ${{ env.BOOST_ROOT != '' }} - run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root + if: ${{ env.BOOST_ROOT_CACHE != '' }} + run: rm -rf boost-root; mv "${BOOST_ROOT_CACHE}" boost-root working-directory: ${{github.workspace}} windows: defaults: diff --git a/ci/github/install.sh b/ci/github/install.sh index c45cc798..60049679 100644 --- a/ci/github/install.sh +++ b/ci/github/install.sh @@ -33,6 +33,11 @@ fi . $(dirname "${BASH_SOURCE[0]}")/../common_install.sh +# Save the state before building anything to avoid caching build artefacts +BOOST_ROOT_CACHE="${BOOST_ROOT}-for-cache" +echo "BOOST_ROOT_CACHE=$BOOST_ROOT_CACHE" >> $GITHUB_ENV +cp -r "$BOOST_ROOT" "$BOOST_ROOT_CACHE" + # Persist the environment for all future steps # Set by common_install.sh