Skip to content

Commit 327330a

Browse files
Christian A. Ehrhardtchrehrhardt
authored andcommitted
ci: Actually use ccache
When building the kernel setup "CC" to actually use ccache. The inherited ccache action should ensure that the cache survives between ci runs. Signed-off-by: Christian A. Ehrhardt <[email protected]>
1 parent 26af818 commit 327330a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
shell: bash
7575
run: |
7676
sudo apt-get update
77-
packages=(build-essential bc bison flex libelf-dev libssl-dev)
77+
packages=(build-essential bc bison flex libelf-dev libssl-dev ccache)
7878
if [[ "${{ matrix.compiler }}" == llvm* ]]; then
7979
VER=${{ matrix.compiler }}
8080
VER=${VER#llvm-}
@@ -137,8 +137,8 @@ jobs:
137137
# Set pipefail to fail if make fails, otherwise any error is squashed
138138
set -o pipefail
139139
ARGS=""
140-
LLVM_DIR=
141140
TARGETS="all"
141+
CCACHE=""
142142
if [ "${{ matrix.arch }}" = "aarch64" ]; then
143143
ARGS="$ARGS ARCH=arm64"
144144
CROSS="aarch64-linux-gnu-"
@@ -154,15 +154,21 @@ jobs:
154154
155155
if [[ "${{ matrix.compiler }}" == "llvm-morello" ]]; then
156156
# The docker image does not have gcc installed, use Morello clang as the host compiler.
157-
ARGS="$ARGS LLVM=$(dirname $(which clang))/ HOSTCC=clang HOSTCXX=clang++"
157+
158+
LLVM="$(dirname $(which clang))"
159+
CCACHE="ccache $LLVM/clang"
160+
ARGS="$ARGS LLVM=$LLVM/ HOSTCC=clang HOSTCXX=clang++"
158161
elif [[ "${{ matrix.compiler }}" == llvm* ]]; then
159-
ARGS="$ARGS LLVM=/usr/lib/${{ matrix.compiler }}/bin/ CROSS_COMPILE=$CROSS"
162+
LLVM=/usr/lib/${{ matrix.compiler }}/bin
163+
CCACHE="ccache $LLVM/clang"
164+
ARGS="$ARGS LLVM=$LLVM/ CROSS_COMPILE=$CROSS"
160165
else
161166
ARGS="$ARGS CROSS_COMPILE=$CROSS"
167+
CCACHE="ccache ${CROSS}gcc"
162168
fi
163169
make $ARGS O=build ${{ matrix.config }}
164170
# Pipe output to tee so we can see it and save it for counting warnings
165-
make $ARGS O=build -j$(nproc) ${TARGETS} 2>&1 | tee build.log
171+
make $ARGS CC="$CCACHE" O=build -j$(nproc) ${TARGETS} 2>&1 | tee build.log
166172
167173
- name: Run clang-tidy
168174
if: matrix.compiler == 'llvm-cheri'

0 commit comments

Comments
 (0)