github: Remove commit ID from cache keys

This reduces the cache storage for active branches and since caches for
different branches are separate and we abort previous builds of the same
branch, this is not necessary to ensure caches can successfully be stored.
This commit is contained in:
Tobias Brunner
2026-04-17 15:18:11 +02:00
parent 1d36cae26a
commit 60f4c86780
7 changed files with 12 additions and 30 deletions
+1 -3
View File
@@ -45,9 +45,7 @@ jobs:
- uses: actions/cache@v5 - uses: actions/cache@v5
with: with:
path: ~/.cache/ccache path: ~/.cache/ccache
key: ccache-android-${{ github.sha }} key: ccache-android
restore-keys: |
ccache-android-
# necessary for newer versions of the Gradle plugin # necessary for newer versions of the Gradle plugin
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
+2 -4
View File
@@ -54,11 +54,9 @@ jobs:
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: ~/.cache/ccache path: ~/.cache/ccache
key: ccache-ubuntu-latest-gcc-codeql-${{ github.sha }} key: ccache-ubuntu-latest-gcc-codeql
restore-keys: | restore-keys: |
ccache-ubuntu-latest-gcc-codeql ccache-ubuntu-latest-gcc-all
ccache-ubuntu-latest-gcc-all-${{ github.sha }}
ccache-ubuntu-latest-gcc-all-
ccache-ubuntu-latest-gcc- ccache-ubuntu-latest-gcc-
- if: matrix.language == 'cpp' - if: matrix.language == 'cpp'
run: | run: |
+5 -11
View File
@@ -72,9 +72,8 @@ jobs:
# builds and, similarly, builds with leak-detective only differ in two # builds and, similarly, builds with leak-detective only differ in two
# files (LD itself and library.c); but different tests build different # files (LD itself and library.c); but different tests build different
# dependencies, so different caches are needed # dependencies, so different caches are needed
key: ccache-ubuntu-latest-${{ env.CC }}-${{ matrix.test }}-${{ github.sha }} key: ccache-ubuntu-latest-${{ env.CC }}-${{ matrix.test }}
restore-keys: | restore-keys: |
ccache-ubuntu-latest-${{ env.CC }}-${{ matrix.test }}-
ccache-ubuntu-latest-${{ env.CC }}- ccache-ubuntu-latest-${{ env.CC }}-
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
@@ -130,11 +129,9 @@ jobs:
path: | path: |
~/.cache/ccache ~/.cache/ccache
~/.ccache ~/.ccache
key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}-${{ github.sha }} key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}
restore-keys: | restore-keys: |
ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}- ccache-${{ matrix.os }}-${{ env.CC }}-all
ccache-${{ matrix.os }}-${{ env.CC }}-all-${{ github.sha }}
ccache-${{ matrix.os }}-${{ env.CC }}-all-
ccache-${{ matrix.os }}-${{ env.CC }}- ccache-${{ matrix.os }}-${{ env.CC }}-
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
@@ -183,9 +180,8 @@ jobs:
path: | path: |
~/.cache/ccache ~/.cache/ccache
~/.ccache ~/.ccache
key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}-${{ github.sha }} key: ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}
restore-keys: | restore-keys: |
ccache-${{ matrix.os }}-${{ env.CC }}-${{ matrix.test }}-
ccache-${{ matrix.os }}-${{ env.CC }}- ccache-${{ matrix.os }}-${{ env.CC }}-
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
@@ -218,9 +214,7 @@ jobs:
- uses: actions/cache@v5 - uses: actions/cache@v5
with: with:
path: ~/.cache/ccache path: ~/.cache/ccache
key: ccache-alpine-${{ github.sha }} key: ccache-alpine
restore-keys: |
ccache-alpine-
- run: ccache -z - run: ccache -z
# don't use the default action as we don't want to build dependencies or install bash # don't use the default action as we don't want to build dependencies or install bash
- run: ./scripts/test.sh deps - run: ./scripts/test.sh deps
+1 -3
View File
@@ -39,9 +39,7 @@ jobs:
- uses: actions/cache@v5 - uses: actions/cache@v5
with: with:
path: ~/Library/Caches/ccache path: ~/Library/Caches/ccache
key: ccache-${{ runner.os }}-${{ github.sha }} key: ccache-${{ runner.os }}
restore-keys: |
ccache-${{ runner.os }}-
# workaround for conflict between Python installed in the image and via brew # workaround for conflict between Python installed in the image and via brew
- run: find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete -print - run: find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete -print
- run: | - run: |
+1 -3
View File
@@ -37,9 +37,7 @@ jobs:
with: with:
path: | path: |
~/.cache/ccache ~/.cache/ccache
key: ccache-sonarcloud-${{ github.sha }} key: ccache-sonarcloud
restore-keys: |
ccache-sonarcloud-
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
+1 -3
View File
@@ -35,9 +35,7 @@ jobs:
- uses: actions/cache@v5 - uses: actions/cache@v5
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ccache-tkm-${{ github.sha }} key: ccache-tkm
restore-keys: |
ccache-tkm-
- name: Build Docker Image - name: Build Docker Image
run: docker build -t strongswan-tkm -f testing/tkm/Dockerfile testing run: docker build -t strongswan-tkm -f testing/tkm/Dockerfile testing
- name: Run Tests in Container - name: Run Tests in Container
+1 -3
View File
@@ -42,9 +42,7 @@ jobs:
- uses: actions/cache@v5 - uses: actions/cache@v5
with: with:
path: ~/.cache/ccache path: ~/.cache/ccache
key: ccache-${{ runner.os }}-${{ matrix.test }}-${{ github.sha }} key: ccache-${{ runner.os }}-${{ matrix.test }}
restore-keys: |
ccache-${{ runner.os }}-${{ matrix.test }}-
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV