@@ -43,13 +43,13 @@ jobs:
4343 if [ "${{ runner.os }}" = "Linux" ]; then
4444 if command -v apk > /dev/null 2>&1; then
4545 apk update
46- apk add --no-cache bash git gcc g++ musl-dev make curl tar sed gnupg file perl linux-headers cmake diffutils tcl unzip openjdk17
46+ apk add --no-cache bash git gcc g++ musl-dev make curl tar sed gnupg file perl linux-headers cmake diffutils tcl unzip openjdk17 ccache
4747 else
4848 dnf update -y
49- dnf install -y git gcc gcc-c++ libstdc++-static glibc-devel make curl tar sed bash gnupg file perl kernel-headers cmake diffutils tcl unzip
49+ dnf install -y git gcc gcc-c++ libstdc++-static glibc-devel make curl tar sed bash gnupg file perl kernel-headers cmake diffutils tcl unzip ccache
5050 fi
5151 elif [ "${{ runner.os }}" = "macOS" ]; then
52- brew install make tcl-tk mimalloc
52+ brew install make tcl-tk mimalloc ccache
5353 elif [ "${{ runner.os }}" = "Windows" ]; then
5454 choco install mingw make magicsplat-tcl-tk -y --no-progress
5555 fi
@@ -159,6 +159,20 @@ jobs:
159159 path : OpenSSL/build
160160 key : openssl-${{ matrix.platform }}-${{ hashFiles('OpenSSL/openssl.properties', 'OpenSSL/build.gradle.kts', 'OpenSSL/build_libraries.sh') }}
161161
162+ - name : ' ccache'
163+ if : runner.os != 'Windows'
164+ uses : actions/cache@v5
165+ with :
166+ path : ~/.cache/ccache
167+ key : ccache-${{ matrix.platform }}
168+ restore-keys : ccache-${{ matrix.platform }}-
169+
170+ - name : ' Configure ccache'
171+ if : runner.os != 'Windows'
172+ run : |
173+ ccache --set-config=max_size=300M
174+ ccache --zero-stats
175+
162176 - name : ' Configure Gradle'
163177 run : |
164178 echo 'org.gradle.caching=false' >> gradle.properties
@@ -180,6 +194,10 @@ jobs:
180194 fi
181195 ./gradlew :selekt-sqlite3-sqlcipher:jar
182196
197+ - name : ' ccache stats'
198+ if : runner.os != 'Windows'
199+ run : ccache --show-stats
200+
183201 - name : ' Verify native library'
184202 run : |
185203 LIB=$(find SQLite3/build/intermediates/libs \( -name 'libselekt.*' -o -name 'selekt.dll' \) -type f | head -1)
0 commit comments