Skip to content

Commit

Permalink
GHA: Cache boost checkout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Flamefire committed Nov 28, 2024
1 parent d8caa39 commit d7b4ba3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ jobs:
BDDE_ARCH: ${{matrix.arch}}
run: ci/github/setup_bdde.sh

- name: Cache Boost checkout
uses: actions/cache@v4
with:
path: boost-root
key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-${{github.sha}}
restore-keys: boost-checkout-cache-${{matrix.os}}-${{matrix.container}}-

- name: Setup Boost
env:
B2_ADDRESS_MODEL: ${{matrix.address-model}}
Expand Down Expand Up @@ -272,6 +279,10 @@ jobs:
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}

- name: Prepare for cache
if: ${{ env.BOOST_ROOT != '' }}
run: rm -rf boost-root; mv "${BOOST_ROOT}" boost-root
working-directory: ${{github.workspace}}
windows:
defaults:
run:
Expand Down
2 changes: 2 additions & 0 deletions ci/common_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ else
export BOOST_BRANCH="develop"
fi

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

if [ ! -d boost-root ]; then
Expand Down

0 comments on commit d7b4ba3

Please sign in to comment.