Skip to content

Commit d7b4ba3

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 d8caa39 commit d7b4ba3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ jobs:
225225
BDDE_ARCH: ${{matrix.arch}}
226226
run: ci/github/setup_bdde.sh
227227

228+
- name: Cache Boost checkout
229+
uses: actions/cache@v4
230+
with:
231+
path: boost-root
232+
key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-${{github.sha}}
233+
restore-keys: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-
234+
228235
- name: Setup Boost
229236
env:
230237
B2_ADDRESS_MODEL: ${{matrix.address-model}}
@@ -272,6 +279,10 @@ jobs:
272279
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
273280
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
274281

282+
- name: Prepare for cache
283+
if: ${{ env.BOOST_ROOT != '' }}
284+
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
285+
working-directory: ${{github.workspace}}
275286
windows:
276287
defaults:
277288
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)