From 5aa75a4393fb7f2705dfbe48d5cf31f55aee923e 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 | 19 +++++++++++++++++++ ci/common_install.sh | 2 ++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e48fe3..55b5f5f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,6 +245,21 @@ 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}}-${{github.sha}} + restore-keys: ${{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}}-${{github.sha}} + restore-keys: ${{matrix.os}}-${{matrix.container}}- + - name: Setup Boost env: B2_ADDRESS_MODEL: ${{matrix.address-model}} @@ -292,6 +307,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 91fddbcc..99ea251a 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