Skip to content

Commit 5aa75a4

Browse files
committed
GHA: Cache boost checkout
Instead of cloning the Boost main repository and later potentially many submodules (by `depinst.py`) we can cache the last checkout. On any changes the checkout-and-pull should update it to the appropriate version.
1 parent 341eee7 commit 5aa75a4

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ jobs:
245245
BDDE_ARCH: ${{matrix.arch}}
246246
run: ci/github/setup_bdde.sh
247247

248+
- name: Cache Boost checkout
249+
uses: actions/cache@v3
250+
if: env.GHA_USE_NODE_20 == 'false'
251+
with:
252+
path: boost-root
253+
key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-${{github.sha}}
254+
restore-keys: ${{matrix.os}}-${{matrix.container}}-
255+
- name: Cache Boost checkout
256+
uses: actions/cache@v4
257+
if: env.GHA_USE_NODE_20 == 'true'
258+
with:
259+
path: boost-root
260+
key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-${{github.sha}}
261+
restore-keys: ${{matrix.os}}-${{matrix.container}}-
262+
248263
- name: Setup Boost
249264
env:
250265
B2_ADDRESS_MODEL: ${{matrix.address-model}}
@@ -292,6 +307,10 @@ jobs:
292307
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
293308
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
294309

310+
- name: Prepare for cache
311+
if: ${{ env.BOOST_ROOT != '' }}
312+
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
313+
working-directory: ${{github.workspace}}
295314
windows:
296315
defaults:
297316
run:

ci/common_install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ else
4343
export BOOST_BRANCH="develop"
4444
fi
4545

46+
# CI cache might have restored the boost-root folder in the current directory
47+
[ ! -d boost-root ] || mv boost-root ..
4648
cd ..
4749

4850
if [ ! -d boost-root ]; then

0 commit comments

Comments
 (0)