From 70449efba36277a9b654e69d4743fa0a738cf493 Mon Sep 17 00:00:00 2001 From: kshackleton1 Date: Wed, 6 May 2026 07:22:57 +0100 Subject: [PATCH] Add ccache to native JAR CI builds Signed-off-by: kshackleton1 --- .github/workflows/continuous-integration.yml | 24 +++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c229307f44..26b8dca12a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -43,13 +43,13 @@ jobs: if [ "${{ runner.os }}" = "Linux" ]; then if command -v apk > /dev/null 2>&1; then apk update - apk add --no-cache bash git gcc g++ musl-dev make curl tar sed gnupg file perl linux-headers cmake diffutils tcl unzip openjdk17 + 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 else dnf update -y - 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 + 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 fi elif [ "${{ runner.os }}" = "macOS" ]; then - brew install make tcl-tk mimalloc + brew install make tcl-tk mimalloc ccache elif [ "${{ runner.os }}" = "Windows" ]; then choco install mingw make magicsplat-tcl-tk -y --no-progress fi @@ -180,6 +180,20 @@ jobs: SQLite3/src/main/external/sqlcipher/sqlite3.h key: sqlcipher-amalgamation-${{ matrix.platform }}-${{ hashFiles('SQLite3/src/main/external/sqlcipher/src/**', 'SQLite3/src/main/external/sqlcipher/VERSION') }} + - name: 'ccache' + if: runner.os != 'Windows' + uses: actions/cache@v5 + with: + path: ~/.cache/ccache + key: ccache-${{ matrix.platform }} + restore-keys: ccache-${{ matrix.platform }}- + + - name: 'Configure ccache' + if: runner.os != 'Windows' + run: | + ccache --set-config=max_size=300M + ccache --zero-stats + - name: 'Configure Gradle' run: | echo 'org.gradle.caching=false' >> gradle.properties @@ -201,6 +215,10 @@ jobs: fi ./gradlew :selekt-sqlite3-sqlcipher:jar + - name: 'ccache stats' + if: runner.os != 'Windows' + run: ccache --show-stats + - name: 'Verify native library' run: | LIB=$(find SQLite3/build/intermediates/libs \( -name 'libselekt.*' -o -name 'selekt.dll' \) -type f | head -1)