2929 rm -rf /opt-host/hostedtoolcache
3030 rm -rf /opt-host/az
3131 df -h
32+
3233 - name : Checkout sources
3334 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3435 with :
4142 cp -vR * /home/build/linux
4243 chown -vR build /home/build/linux
4344
45+ - name : Restore ccache
46+ if : github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
47+ uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
48+ with :
49+ path : .ccache
50+ key : ccache-arch-${{ hashFiles('config') }}
51+ restore-keys : ccache-arch-
52+
4453 - name : Set up pacman keyring
4554 run : |
4655 pacman-key --init
@@ -49,13 +58,33 @@ jobs:
4958
5059 - name : Install dependencies
5160 run : |
52- pacman -Syu --noconfirm bc cpio gettext libelf pahole perl python rust rust-bindgen rust-src tar xz graphviz imagemagick python-sphinx python-yaml texlive-latexextra
61+ 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
62+
63+ - name : Configure ccache
64+ run : |
65+ mkdir -p $GITHUB_WORKSPACE/.ccache
66+ chown -R build $GITHUB_WORKSPACE/.ccache
67+ export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache
68+ ccache -M 3G
69+ ccache -z
5370
5471 - name : Build linux package
5572 id : build-kernel-package
5673 shell : bash
5774 run : |
58- su build bash -c "cd /home/build/linux/arch && MAKEFLAGS=-j$(nproc) makepkg --skippgpcheck"
75+ 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"
5976 . /home/build/linux/arch/PKGBUILD
6077 full_version=${pkgver}-${pkgrel}
6178 echo "full_version=$full_version" >> "$GITHUB_OUTPUT"
79+
80+ - name : ccache statistics
81+ if : success() || failure()
82+ run : |
83+ CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -s
84+
85+ - name : Save ccache
86+ if : success() || failure()
87+ uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
88+ with :
89+ path : .ccache
90+ key : ccache-arch-${{ hashFiles('config') }}
0 commit comments