Skip to content

Commit c769db1

Browse files
ventureooptr1337
authored andcommitted
ci: Use ccache to speed up builds
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
1 parent fa35acd commit c769db1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- '.github/workflows/build.yml'
77
workflow_dispatch:
88

9+
env:
10+
CCACHE_DIR: /home/builder/.ccache
11+
912
jobs:
1013
build:
1114
name: linux-cachyos
@@ -29,7 +32,7 @@ jobs:
2932
pacman-key --init
3033
pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com
3134
pacman-key --lsign-key F3B607488DB35A47
32-
pacman -Syu --noconfirm
35+
pacman -Syu --noconfirm --needed ccache
3336
3437
# Setup builder user
3538
useradd builder -m
@@ -41,6 +44,18 @@ jobs:
4144
4245
# Setup a packager name to indicate that kernel has built with CI
4346
sed -i 's/#PACKAGER=".*"/PACKAGER="CachyOS GitHub Actions"/g' /etc/makepkg.conf
47+
48+
# Setup ccache
49+
sed -i 's|!ccache|ccache|' /etc/makepkg.conf
50+
sudo -u builder mkdir -p ${{ env.CCACHE_DIR }}
51+
- name: Setup ccache
52+
id: cache
53+
uses: actions/cache@v4
54+
with:
55+
path: ${{ env.CCACHE_DIR }}
56+
key: ccache-${{ matrix.toolchain }}-${{ github.run_id }}
57+
restore-keys: |
58+
ccache-${{ matrix.toolchain }}
4459
- name: Build package (${{ matrix.toolchain }})
4560
id: makepkg
4661
env:

0 commit comments

Comments
 (0)