From 7242eb8f4cb2eb44eb4311765a42d98d4a242f48 Mon Sep 17 00:00:00 2001 From: iTrooz_ Date: Wed, 29 Jun 2022 00:24:53 +0200 Subject: [PATCH] git: New cache update (#558) * add CMakeCache.txt to cache * added workflow_dispatch to workflows * remove restore-keys from workflows * Separated cache * re-added restore-keys --- .github/workflows/analysis.yml | 16 ++++++-- .github/workflows/build.yml | 67 ++++++++++++++++++++++++---------- .github/workflows/tests.yml | 15 ++++++-- 3 files changed, 71 insertions(+), 27 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 440c48e17..52a949980 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -3,6 +3,7 @@ name: "CodeQL" on: schedule: - cron: '0 0 * * *' + workflow_dispatch: jobs: codeql: @@ -24,14 +25,21 @@ jobs: with: languages: 'cpp' - - name: 📜 Restore cache + - name: 📜 Restore ccache uses: actions/cache@v3 with: path: | - ~/.ccache + ~/.cache/ccache + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build + + - name: 📜 Restore CMakeCache + uses: actions/cache@v3 + with: + path: | + build/CMakeCache.txt key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - + - name: ⬇️ Install dependencies run: | sudo apt update diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7ed539fb..e7c4b7f63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,29 @@ jobs: with: submodules: recursive + - name: 📜 Prepare Cache + id: prep-ccache + shell: bash + run: | + mkdir -p "${CCACHE_DIR}" + echo "::set-output name=dir::$CCACHE_DIR" + + - name: 📜 Restore ccache + uses: actions/cache@v3 + id: cache-ccache + with: + path: | + ${{ steps.prep-ccache.outputs.dir }} + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build + + - name: 📜 Restore CMakeCache + uses: actions/cache@v3 + with: + path: | + build/CMakeCache.txt + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} + - name: 🟦 Install msys2 uses: msys2/setup-msys2@v2 with: @@ -53,20 +76,6 @@ jobs: $USERPROFILE/.cargo/bin/rustup.exe target add x86_64-pc-windows-gnu $USERPROFILE/.cargo/bin/rustup.exe default nightly - - name: 📜 Prepare Cache - id: prep-ccache - shell: bash - run: | - mkdir -p "${CCACHE_DIR}" - echo "::set-output name=dir::$CCACHE_DIR" - - - name: 📜 Restore Cache - uses: actions/cache@v3 - id: cache-ccache - with: - path: ${{ steps.prep-ccache.outputs.dir }} - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - - name: 🛠️ Build run: | mkdir -p build @@ -115,17 +124,27 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + + - name: 📜 Restore ccache + uses: actions/cache@v3 + with: + path: | + ~/Library/Caches/ccache + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build + + + - name: 📜 Restore CMakeCache + uses: actions/cache@v3 + with: + path: | + build/CMakeCache.txt + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - name: ⬇️ Install dependencies run: | brew bundle --no-lock --file dist/Brewfile - - name: 📜 Restore cache - uses: actions/cache@v3 - with: - path: ~/Library/Caches/ccache - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - - name: 🛠️ Build run: | mkdir -p build @@ -169,6 +188,14 @@ jobs: with: path: | ~/.cache/ccache + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build + + - name: 📜 Restore other caches + uses: actions/cache@v3 + with: + path: | + build/CMakeCache.txt .flatpak-builder key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad8238470..5a11c2f1a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: branches: [ master ] pull_request: branches: [ master ] + workflow_dispatch: jobs: tests: @@ -21,14 +22,22 @@ jobs: with: submodules: recursive - - name: 📜 Restore cache + - name: 📜 Restore ccache uses: actions/cache@v3 with: path: | ~/.cache/ccache - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build + + - name: 📜 Restore CMakeCache + uses: actions/cache@v3 + with: + path: | + build/CMakeCache.txt + key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} + - name: ⬇️ Install dependencies run: | sudo apt update