Skip to content

Commit 8097ca0

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 29a7e9f commit 8097ca0

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
@@ -308,8 +308,8 @@ jobs:
308308
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
309309

310310
- name: Prepare for cache
311-
if: ${{ env.BOOST_ROOT != '' }}
312-
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
311+
if: ${{ env.BOOST_ROOT_CACHE != '' }}
312+
run: rm -rf boost-root; mv "${BOOST_ROOT_CACHE}" boost-root
313313
working-directory: ${{github.workspace}}
314314
windows:
315315
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)