Skip to content

Commit cb3b3fb

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 ece2826 commit cb3b3fb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/ci.yml

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

282282
- name: Prepare for cache
283-
if: ${{ env.BOOST_ROOT != '' }}
284-
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
283+
if: ${{ env.BOOST_ROOT_CACHE != '' }}
284+
run: rm -rf boost-root; mv "${BOOST_ROOT_CACHE}" boost-root
285285
working-directory: ${{github.workspace}}
286286
windows:
287287
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)