Skip to content

Commit 74d7b5e

Browse files
Add ccache to native JAR CI builds
Signed-off-by: kshackleton1 <kshackleton1@bloomberg.net>
1 parent a898b26 commit 74d7b5e

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -180,6 +180,20 @@ jobs:
180180
SQLite3/src/main/external/sqlcipher/sqlite3.h
181181
key: sqlcipher-amalgamation-${{ matrix.platform }}-${{ hashFiles('SQLite3/src/main/external/sqlcipher/src/**', 'SQLite3/src/main/external/sqlcipher/VERSION') }}
182182

183+
- name: 'ccache'
184+
if: runner.os != 'Windows'
185+
uses: actions/cache@v5
186+
with:
187+
path: ~/.cache/ccache
188+
key: ccache-${{ matrix.platform }}
189+
restore-keys: ccache-${{ matrix.platform }}-
190+
191+
- name: 'Configure ccache'
192+
if: runner.os != 'Windows'
193+
run: |
194+
ccache --set-config=max_size=300M
195+
ccache --zero-stats
196+
183197
- name: 'Configure Gradle'
184198
run: |
185199
echo 'org.gradle.caching=false' >> gradle.properties
@@ -201,6 +215,10 @@ jobs:
201215
fi
202216
./gradlew :selekt-sqlite3-sqlcipher:jar
203217
218+
- name: 'ccache stats'
219+
if: runner.os != 'Windows'
220+
run: ccache --show-stats
221+
204222
- name: 'Verify native library'
205223
run: |
206224
LIB=$(find SQLite3/build/intermediates/libs \( -name 'libselekt.*' -o -name 'selekt.dll' \) -type f | head -1)

0 commit comments

Comments
 (0)