Skip to content

Commit c98b1f2

Browse files
committed
CI/Gentoo: Cache each cmake_args build separately
Since GCC is no longer covered by an upstream binary package, we should avoid rebuilding it every time
1 parent f5a4671 commit c98b1f2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/build.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ jobs:
4848
path: pkg-cache
4949
key: never-exists
5050
restore-keys: |
51-
${{ matrix.os }}-pkg-cache-
51+
${{ matrix.os }}/pkg-cache/${{ matrix.config.cmake_args }}/
52+
${{ matrix.os }}/pkg-cache/
5253
5354
- name: Build inside Docker
5455
id: docker-build
@@ -117,13 +118,11 @@ jobs:
117118
set -ex
118119
'
119120
CLEANUP_CMD='
120-
if ls -d /var/db/pkg/llvm-core/clang-*; then
121-
[ -e /tmp/initial-pkg-cache.cksum ] && cache_cksum >/tmp/final-pkg-cache.cksum
122-
if ! diff -u /tmp/{initial,final}-pkg-cache.cksum; then
123-
( cd /var/db/repos && tar --sort=name -cpJf /var/cache/binpkgs/gentoo-repo.txz gentoo )
124-
touch /output/SAVE_CACHE
125-
eclean -t 2w packages --changed-deps
126-
fi
121+
[ -e /tmp/initial-pkg-cache.cksum ] && cache_cksum >/tmp/final-pkg-cache.cksum
122+
if ! diff -u /tmp/{initial,final}-pkg-cache.cksum; then
123+
( cd /var/db/repos && tar --sort=name -cpJf /var/cache/binpkgs/gentoo-repo.txz gentoo )
124+
touch /output/SAVE_CACHE
125+
eclean -t 2w packages --changed-deps
127126
fi
128127
'
129128
;;
@@ -167,4 +166,4 @@ jobs:
167166
uses: actions/cache/save@v4
168167
with:
169168
path: pkg-cache
170-
key: ${{ matrix.os }}-pkg-cache-${{ github.sha }}
169+
key: ${{ matrix.os }}/pkg-cache/${{ matrix.config.cmake_args }}/${{ github.sha }}

0 commit comments

Comments
 (0)