]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
github: Evict old entries from ccache
authorTobias Brunner <tobias@strongswan.org>
Tue, 19 May 2026 09:29:27 +0000 (11:29 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 May 2026 15:24:22 +0000 (17:24 +0200)
We don't want to build old versions using these caches, so we don't
need old entries (if header files change, there could be lots of
differences that increase the cache size unnecessarily).

.github/workflows/android.yml
.github/workflows/linux.yml
.github/workflows/macos.yml
.github/workflows/sonarcloud.yml
.github/workflows/tkm.yml
.github/workflows/windows.yml

index a29c8da7bbae5998734bf3b7cfa524733d6be00f..4d7c97fba39bf584196fca872397d059ab86e649 100644 (file)
@@ -13,6 +13,7 @@ env:
   CCACHE_BASEDIR: ${{ github.workspace }}
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 150M
+  EVICT_CCACHE_AGE: 1200s
   CC: gcc
   OS_NAME: linux
 
@@ -68,6 +69,10 @@ jobs:
         with:
           name: Lint Results
           path: src/frontends/android/app/build/reports/lint-results*.xml
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
index 2a21f0c4e05f97f2a3ce544670ac7f583c536364..8ed484b011dbac96837ef2bd6fc1802763c74f72 100644 (file)
@@ -17,6 +17,7 @@ env:
   CCACHE_BASEDIR: ${{ github.workspace }}
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 100M
+  EVICT_CCACHE_AGE: 1200s
   OS_NAME: linux
 
 jobs:
@@ -101,6 +102,10 @@ jobs:
           ccache -z
       - run: ./scripts/test.sh build-deps
       - run: ccache -sv
+      - if: fromJSON(env.STORE_DEPS_CACHE)
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -121,6 +126,10 @@ jobs:
       - run: ccache -z
       - run: ./scripts/test.sh
       - run: ccache -sv
+      - if: fromJSON(env.STORE_CACHE)
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -207,6 +216,10 @@ jobs:
           echo "TESTS_ACTIVE_TRANSFORMS=$HOME/active-transforms.log" >> $GITHUB_ENV
       - run: ./scripts/test.sh build-deps
       - run: ccache -sv
+      - if: fromJSON(env.STORE_DEPS_CACHE)
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -236,7 +249,6 @@ jobs:
       - name: Verify active transforms
         run: |
           test ! -f $ACTIVE_TRANSFORMS_REF || diff -us --color=always $ACTIVE_TRANSFORMS_REF $TESTS_ACTIVE_TRANSFORMS
-      - run: ccache -sv
       - if: ${{ failure() }}
         uses: actions/upload-artifact@v6
         with:
@@ -279,6 +291,10 @@ jobs:
           ccache -z
       - run: ./scripts/test.sh build-deps
       - run: ccache -sv
+      - if: fromJSON(env.STORE_DEPS_CACHE)
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -299,6 +315,10 @@ jobs:
       - run: ccache -z
       - run: ./scripts/test.sh
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -342,6 +362,10 @@ jobs:
       - run: ./scripts/test.sh deps
       - run: ./scripts/test.sh
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
index c74d73a8dff9acf2adf5f24ed926e5d11373dfb6..3a5118452b13d084d75a2d4269ce8bc771b4bb4b 100644 (file)
@@ -14,6 +14,7 @@ env:
   CCACHE_BASEDIR: ${{ github.workspace }}
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 100M
+  EVICT_CCACHE_AGE: 1200s
   OS_NAME: macos
 
 jobs:
@@ -52,6 +53,10 @@ jobs:
           ccache -z
       - uses: ./.github/actions/default
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
index d6c02698be4be41e2da1727272743e2dd1308e88..f28facbe9100db8e9bdaa914905d69556f24f4fe 100644 (file)
@@ -13,6 +13,7 @@ env:
   CCACHE_BASEDIR: ${{ github.workspace }}
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 100M
+  EVICT_CCACHE_AGE: 1200s
   OS_NAME: linux
 
 jobs:
@@ -68,6 +69,10 @@ jobs:
             -Dsonar.cfamily.threads=2
             -Dsonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
index 7eb2d6b1a05fed65c1c658bd523fa09f696edb63..44fe35e958ce9f0bfdf7ba6901f7309dfe41639c 100644 (file)
@@ -15,6 +15,7 @@ env:
   CCACHE_COMPILERCHECK: content
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 100M
+  EVICT_CCACHE_AGE: 1200s
 
 jobs:
   pre-check:
@@ -52,6 +53,7 @@ jobs:
             -e CCACHE_COMPILERCHECK \
             -e CCACHE_COMPRESS \
             -e CCACHE_MAXSIZE \
+            -e EVICT_CCACHE_AGE \
             strongswan-tkm \
             bash -c "ccache -z; \
             echo '### build charon-tkm'; \
@@ -75,6 +77,8 @@ jobs:
             make -j check TESTS_RUNNERS=tkm TESTS_TKM=1 || exit 1; \
             cat /tmp/tkm.log; \
             ccache -sv; \
+            ccache --evict-older-than $EVICT_CCACHE_AGE; \
+            ccache -sv; \
             "
       # delete old cache entry as we currently can't update it any other way
       - env:
index 177ce7c8a842e2ef8e4fa12df63f4c28ae1ecf84..039085458a9e07d4d65af58a36cdb8d223f206b4 100644 (file)
@@ -16,6 +16,7 @@ env:
   # since the compilers are newly installed every time, we have to use this to
   # avoid cache misses
   CCACHE_COMPILERCHECK: content
+  EVICT_CCACHE_AGE: 1200s
   MONOLITHIC: yes
 
 jobs:
@@ -53,6 +54,10 @@ jobs:
           ccache -sz
       - uses: ./.github/actions/default
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}
@@ -114,6 +119,10 @@ jobs:
         # sometimes streaming/threading tests hang completely
         timeout-minutes: 30
       - run: ccache -sv
+      - if: github.event_name == 'push'
+        run: |
+          ccache --evict-older-than ${{ env.EVICT_CCACHE_AGE }}
+          ccache -sv
       # delete old cache entry as we currently can't update it any other way
       - env:
           GH_TOKEN: ${{ github.token }}