From 4a31b93cb35dfdc4d9099ad1ec01f1f6da0455db Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 26 Nov 2024 09:48:06 +0100 Subject: [PATCH] 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. --- .github/workflows/ci.yml | 17 +++++++++++++++++ ci/common_install.sh | 2 ++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e48fe3..5d3ce3c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,6 +245,19 @@ jobs: BDDE_ARCH: ${{matrix.arch}} run: ci/github/setup_bdde.sh + - name: Cache Boost checkout + uses: actions/cache@v3 + if: env.GHA_USE_NODE_20 == 'false' + with: + path: boost-root + key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}} + - name: Cache Boost checkout + uses: actions/cache@v4 + if: env.GHA_USE_NODE_20 == 'true' + with: + path: boost-root + key: boost-checkout-cache-${{matrix.os}}-${{matrix.container}} + - name: Setup Boost env: B2_ADDRESS_MODEL: ${{matrix.address-model}} @@ -292,6 +305,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: diff --git a/ci/common_install.sh b/ci/common_install.sh index 01eada0d..b8cd5de3 100644 --- a/ci/common_install.sh +++ b/ci/common_install.sh @@ -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