6565 cp -vR * /home/build/linux
6666 chown -vR build /home/build/linux
6767
68+ - name : Restore ccache
69+ uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
70+ with :
71+ path : .ccache
72+ key : ccache-arch-${{ hashFiles('config') }}
73+ restore-keys : ccache-arch-
74+
6875 - name : Set up pacman keyring
6976 run : |
7077 pacman-key --init
@@ -73,13 +80,21 @@ jobs:
7380
7481 - name : Install dependencies
7582 run : |
76- pacman -Syu --noconfirm bc cpio gettext jq libelf pahole perl python rust rust-bindgen rust-src tar xz graphviz imagemagick python-sphinx python-yaml texlive-latexextra
83+ pacman -Syu --noconfirm bc ccache cpio gettext libelf pahole perl python rust rust-bindgen rust-src tar xz graphviz imagemagick python-sphinx python-yaml texlive-latexextra
84+
85+ - name : Configure ccache
86+ run : |
87+ mkdir -p $GITHUB_WORKSPACE/.ccache
88+ chown -R build $GITHUB_WORKSPACE/.ccache
89+ export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache
90+ ccache -M 3G
91+ ccache -z
7792
7893 - name : Build linux package
7994 id : build-kernel-package
8095 shell : bash
8196 run : |
82- su build bash -c "cd /home/build/linux/arch && MAKEFLAGS=-j$(nproc) makepkg --skippgpcheck"
97+ su build bash -c "export CC='ccache gcc' CCACHE_DIR=$GITHUB_WORKSPACE/.ccache CCACHE_BASEDIR=/home/build/linux/arch/src/linux-6.19.6 && cd /home/build/linux/arch && MAKEFLAGS=-j$(nproc) makepkg --skippgpcheck"
8398 . /home/build/linux/arch/PKGBUILD
8499 full_version=${pkgver}-${pkgrel}
85100 echo "full_version=$full_version" >> "$GITHUB_OUTPUT"
@@ -144,3 +159,15 @@ jobs:
144159 --certificate-identity-regexp=".*" \
145160 --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
146161 "${REPO}:${VERSION}"
162+
163+ - name : ccache statistics
164+ if : success() || failure()
165+ run : |
166+ CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -s
167+
168+ - name : Save ccache
169+ if : startsWith(github.ref, 'refs/tags/')
170+ uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
171+ with :
172+ path : .ccache
173+ key : ccache-arch-${{ hashFiles('config') }}
0 commit comments