From 669e5b91b438d150b4e2cc9dde91d58232bab4c7 Mon Sep 17 00:00:00 2001 From: friendlyanon <1736896+friendlyanon@users.noreply.github.com> Date: Thu, 5 Nov 2020 14:42:00 +0100 Subject: [PATCH] Improve CI workflows (#1291) * Fix Cirrus CI CMake is not installed at this point yet. * Add caching in Circle CI * Add caching to the MinGW Github workflows * Fix Circle CI config Co-authored-by: friendlyanon --- .circleci/config.yml | 15 +++++++++++++++ .cirrus.yml | 2 +- .github/workflows/mingw-ci.yml | 6 ++++++ .github/workflows/mingw64-ci.yml | 6 ++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d52b51023..1360cc3a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,6 +61,19 @@ executors: # Reusable test commands (and initializer for clang 6) commands: + dependency_restore: + steps: + - restore_cache: + keys: + - cmake-cache-{{ checksum "dependencies/CMakeLists.txt" }} + + dependency_cache: + steps: + - save_cache: + key: cmake-cache-{{ checksum "dependencies/CMakeLists.txt" }} + paths: + - dependencies/.cache + install_cmake: steps: - run: apt-get update -qq @@ -74,7 +87,9 @@ commands: cmake_build_cache: steps: - cmake_prep + - dependency_restore - run: cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination -B build . + - dependency_cache # dependencies are produced in the configure step cmake_build: steps: diff --git a/.cirrus.yml b/.cirrus.yml index 7d22d4f01..ddabd38b4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,7 +10,7 @@ task: dep_cache: folder: $HOME/.dep_cache reupload_on_changes: false - fingerprint_script: cmake -E sha512sum dependencies/CMakeLists.txt + fingerprint_script: cat dependencies/CMakeLists.txt setup_script: - pkg update -f - pkg install bash diff --git a/.github/workflows/mingw-ci.yml b/.github/workflows/mingw-ci.yml index 2aa16d291..36b7d0c56 100644 --- a/.github/workflows/mingw-ci.yml +++ b/.github/workflows/mingw-ci.yml @@ -26,6 +26,12 @@ jobs: path: | C:\ProgramData\scoop key: scoop32 # static key: should be good forever + + - uses: actions/cache@v2 + with: + path: dependencies/.cache + key: ${{ hashFiles('dependencies/CMakeLists.txt') }} + - name: Setup Windows # This should almost never run if the cache works. if: steps.cache.outputs.cache-hit != 'true' shell: powershell diff --git a/.github/workflows/mingw64-ci.yml b/.github/workflows/mingw64-ci.yml index c106cc97e..912e1cfbf 100644 --- a/.github/workflows/mingw64-ci.yml +++ b/.github/workflows/mingw64-ci.yml @@ -26,6 +26,12 @@ jobs: path: | C:\ProgramData\scoop key: scoop64 # static key: should be good forever + + - uses: actions/cache@v2 + with: + path: dependencies/.cache + key: ${{ hashFiles('dependencies/CMakeLists.txt') }} + - name: Setup Windows # This should almost never run if the cache works. if: steps.cache.outputs.cache-hit != 'true' shell: powershell