6565 cp -vR * /home/build/linux
6666 chown -vR build /home/build/linux
6767
68+ - name : Restore ccache
69+ if : github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
70+ uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
71+ with :
72+ path : .ccache
73+ key : ccache-arch-${{ hashFiles('config') }}
74+ restore-keys : ccache-arch-
75+
6876 - name : Set up pacman keyring
6977 run : |
7078 pacman-key --init
@@ -73,13 +81,21 @@ jobs:
7381
7482 - name : Install dependencies
7583 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
84+ 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
85+
86+ - name : Configure ccache
87+ run : |
88+ mkdir -p $GITHUB_WORKSPACE/.ccache
89+ chown -R build $GITHUB_WORKSPACE/.ccache
90+ export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache
91+ ccache -M 3G
92+ ccache -z
7793
7894 - name : Build linux package
7995 id : build-kernel-package
8096 shell : bash
8197 run : |
82- su build bash -c "cd /home/build/linux/arch && MAKEFLAGS=-j$(nproc) makepkg --skippgpcheck"
98+ 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"
8399 . /home/build/linux/arch/PKGBUILD
84100 full_version=${pkgver}-${pkgrel}
85101 echo "full_version=$full_version" >> "$GITHUB_OUTPUT"
@@ -144,3 +160,15 @@ jobs:
144160 --certificate-identity-regexp=".*" \
145161 --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
146162 "${REPO}:${VERSION}"
163+
164+ - name : ccache statistics
165+ if : success() || failure()
166+ run : |
167+ CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -s
168+
169+ - name : Save ccache
170+ if : success() || failure()
171+ uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
172+ with :
173+ path : .ccache
174+ key : ccache-arch-${{ hashFiles('config') }}
0 commit comments