Skip to content

Commit

Permalink
Fix GitHub cache retention
Browse files Browse the repository at this point in the history
Signed-off-by: Tin Švagelj <[email protected]>
  • Loading branch information
Caellian committed Jan 5, 2025
1 parent 54f231b commit 815c539
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-and-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ jobs:
ninja-build \
wayland-protocols
- name: Install sccache
working-directory: /home/runner
run: |
curl -s -L "https://github.com/mozilla/sccache/releases/download/v${{ env.SCCACHE_VERSION }}/sccache-v${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl.tar.gz" \
| tar xvz -C .
chmod +x "sccache-v${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl/sccache"
sudo cp "sccache-v${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl/sccache" "/bin/sccache"
rm -rf "sccache-v${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl"
mkdir .sccache
echo "SCCACHE_DIR=$PWD/.sccache" >> $GITHUB_ENV
- name: Install clang and libc++
if: matrix.compiler == 'clang'
run: |
Expand All @@ -94,11 +98,12 @@ jobs:
g++
- name: Checkout
uses: actions/checkout@v4
- name: Load compiler cache
- name: Load cached compilation artifacts
id: compiler-cache
uses: actions/cache@v4
with:
path: "$HOME/.cache/sccache"
key: sccache-${{ matrix.os }}-${{ matrix.x11 }}-${{ matrix.wayland }}-${{ matrix.compiler }}
path: "${{ env.SCCACHE_DIR }}"
key: sccache-${{ matrix.os }}-${{ matrix.x11 }}-${{ matrix.wayland }}-${{ matrix.compiler }}-${{ github.ref }}
- name: Configure with CMake
run: |
set -x # show the commands we're running
Expand Down
4 changes: 2 additions & 2 deletions cmake/CCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ endif()
find_program(CCACHE_COMMAND sccache)
if(CCACHE_COMMAND)
mark_as_advanced(CCACHE_COMMAND)
message(NOTICE "Using sccache; disable with '-DUSE_CCACHE=OFF'")
message(STATUS "Using sccache; disable with '-DUSE_CCACHE=OFF'")
else()
find_program(CCACHE_COMMAND ccache)
if(CCACHE_COMMAND)
mark_as_advanced(CCACHE_COMMAND)
message(NOTICE "Using ccache; disable with '-DUSE_CCACHE=OFF'")
message(STATUS "Using ccache; disable with '-DUSE_CCACHE=OFF'")
else()
message(WARNING "Neither sccache nor ccache found")
return()
Expand Down

0 comments on commit 815c539

Please sign in to comment.