@@ -13,6 +13,10 @@ concurrency:
1313 group : ci-${{ github.ref }}
1414 cancel-in-progress : true
1515
16+ env :
17+ CCACHE_DIR : ${{ github.workspace }}/.ccache
18+ CCACHE_MAXSIZE : 500M
19+
1620jobs :
1721 ubuntu-build :
1822 name : Ubuntu build and tests
@@ -22,65 +26,83 @@ jobs:
2226 - name : Check out source
2327 uses : actions/checkout@v4
2428
29+ - name : Restore compiler cache
30+ uses : actions/cache@v4
31+ with :
32+ path : .ccache
33+ key : ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
34+ restore-keys : |
35+ ${{ runner.os }}-${{ github.job }}-ccache-
36+
2537 - name : Install dependencies
2638 run : |
2739 sudo apt-get update
2840 sudo apt-get install -y --no-install-recommends \
2941 build-essential \
42+ ccache \
3043 cmake \
44+ ninja-build \
3145 libx11-dev \
3246 libssl-dev \
3347 pkg-config \
3448 zlib1g-dev
3549
3650 - name : Configure
37- run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
51+ run : cmake -S . -B build -G Ninja - DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
3852
3953 - name : Build
4054 run : cmake --build build --parallel
4155
4256 - name : Test
4357 run : ctest --test-dir build --output-on-failure
4458
59+ - name : Compiler cache stats
60+ run : ccache --show-stats
61+
4562 fedora-build :
4663 name : Fedora build and tests
4764 runs-on : ubuntu-latest
4865 container :
4966 image : fedora:latest
5067
5168 steps :
52- - name : Install Git for checkout
53- run : dnf install -y git
54-
55- - name : Check out source
56- uses : actions/checkout@v4
57-
5869 - name : Install dependencies
5970 run : |
60- dnf install -y \
71+ dnf install -y --setopt=install_weak_deps=False \
72+ ccache \
6173 cmake \
6274 gcc-c++ \
75+ git \
6376 gtk3-devel \
6477 libayatana-appindicator3-devel \
6578 libX11-devel \
6679 make \
80+ ninja-build \
6781 openssl-devel \
6882 pkgconf-pkg-config \
6983 rpm-build \
7084 systemd-rpm-macros \
7185 zlib-devel
7286
73- - name : Validate RPM packaging skeleton
74- run : MWB_VALIDATE_RPM_BUILD=1 scripts/validate-rpm-packaging.sh
87+ - name : Check out source
88+ uses : actions/checkout@v4
7589
76- - name : Configure
77- run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
90+ - name : Restore compiler cache
91+ uses : actions/cache@v4
92+ with :
93+ path : .ccache
94+ key : ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
95+ restore-keys : |
96+ ${{ runner.os }}-${{ github.job }}-ccache-
7897
79- - name : Build
80- run : cmake --build build --parallel
98+ - name : Validate RPM packaging, build, and tests
99+ run : |
100+ MWB_VALIDATE_RPM_BUILD=1 \
101+ MWB_RPM_CMAKE_EXTRA_ARGS="-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" \
102+ scripts/validate-rpm-packaging.sh
81103
82- - name : Test
83- run : ctest --test-dir build --output-on-failure
104+ - name : Compiler cache stats
105+ run : ccache --show-stats
84106
85107 sanitizers :
86108 name : ASan and UBSan
@@ -90,26 +112,39 @@ jobs:
90112 - name : Check out source
91113 uses : actions/checkout@v4
92114
115+ - name : Restore compiler cache
116+ uses : actions/cache@v4
117+ with :
118+ path : .ccache
119+ key : ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
120+ restore-keys : |
121+ ${{ runner.os }}-${{ github.job }}-ccache-
122+
93123 - name : Install dependencies
94124 run : |
95125 sudo apt-get update
96126 sudo apt-get install -y --no-install-recommends \
97127 build-essential \
128+ ccache \
98129 cmake \
130+ ninja-build \
99131 libx11-dev \
100132 libssl-dev \
101133 pkg-config \
102134 zlib1g-dev
103135
104136 - name : Configure
105- run : cmake -S . -B build-sanitize -DCMAKE_BUILD_TYPE=Debug -DMWB_ENABLE_SANITIZERS=ON
137+ run : cmake -S . -B build-sanitize -G Ninja - DCMAKE_BUILD_TYPE=Debug -DMWB_ENABLE_SANITIZERS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
106138
107139 - name : Build
108140 run : cmake --build build-sanitize --parallel
109141
110142 - name : Test
111143 run : ctest --test-dir build-sanitize --output-on-failure
112144
145+ - name : Compiler cache stats
146+ run : ccache --show-stats
147+
113148 static-checks :
114149 name : Static checks
115150 runs-on : ubuntu-latest
0 commit comments