Skip to content

Commit ae7891a

Browse files
committed
Avoid caching build artefacts
When we copy the whole boost-root AFTER the build(s) it will contain also build artefacts such as the bin.v2 folder. When restoring that later B2 might skip parts of the build although it should not. Make a copy after the initial setup & bootstrap.
1 parent 3ba023a commit ae7891a

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ jobs:
256256
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
257257

258258
- name: Prepare for cache
259-
if: ${{ env.BOOST_ROOT != '' }}
260-
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
259+
if: ${{ env.BOOST_ROOT_CACHE != '' }}
260+
run: rm -rf boost-root; mv "${BOOST_ROOT_CACHE}" boost-root
261261
working-directory: ${{github.workspace}}
262262
windows:
263263
defaults:

ci/github/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ fi
3333

3434
. $(dirname "${BASH_SOURCE[0]}")/../common_install.sh
3535

36+
# Save the state before building anything to avoid caching build artefacts
37+
BOOST_ROOT_CACHE="${BOOST_ROOT}-for-cache"
38+
echo "BOOST_ROOT_CACHE=$BOOST_ROOT_CACHE" >> $GITHUB_ENV
39+
cp -r "$BOOST_ROOT" "$BOOST_ROOT_CACHE"
40+
3641
# Persist the environment for all future steps
3742

3843
# Set by common_install.sh

0 commit comments

Comments
 (0)