From 762361def61ce83575eaa82d3f6a0991bae362db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 7 Jun 2023 10:34:40 +0200
Subject: [PATCH] CI: cache MSYS2 tarball of Boost, following configuration
 change in the runners

(cherry picked from commit 09cff8003aab9e1f1a9142080635b14defdd1a3b)
---
 .gitlab-ci.yml | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e7f0e738..9d8e3b2e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -37,13 +37,18 @@ build_linux_arm64:
 build_windows_x86_64:
   stage: build
   script:
-    - mkdir -p ~/tarballs
-    - '[[ -f ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P ~/tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst'
+    - mkdir -p tarballs
+    - '[[ -f tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst'
     - mkdir -p deps
-    - tar xf ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst --directory deps
+    - tar xf tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst --directory deps
     - autoreconf -si
     - ./configure --host=x86_64-w64-mingw32 --with-boost=$(pwd)/deps/mingw64/include
     - make -j$(nproc)
+  cache:
+    # This cache is shared between all branches, to save space
+    key: $CI_JOB_NAME
+    paths:
+      - tarballs/
   artifacts:
     paths:
       - src/dynare-preprocessor.exe
-- 
GitLab