Improve compiler and dependency caching in CI
1. In windows.yml (build-msvc), cache and configure ccache via
CMAKE_VS_GLOBALS (CLToolExe=cl.exe, CLToolPath, TrackFileAccess=false,
UseMultiToolTask=true) so Visual Studio 2026 builds cache translation
units across runs just like build-mingw.
2. In linux.yml, cache the extracted libcudss archive with
actions/cache@v4, matching the mold cache and windows.yml.
3. In macos.yml, set HOMEBREW_NO_AUTO_UPDATE=1 and
HOMEBREW_NO_INSTALL_CLEANUP=1 to avoid redundant Homebrew index
updates and post-install cleanups on every job.
4. In android.yml, remove ${{matrix.abi}} from the header-only Eigen
3.4.0 cache key so all four Android ABIs share a single cached
install.
Change-Id: I3d6f5c03a9e216f4b051e9437a2ca3e66d48b233
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 0e63218..e4b067c 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -59,7 +59,7 @@
uses: actions/cache@v4
with:
path: eigen/
- key: NDK-${{matrix.os}}-eigen-3.4.0-${{matrix.abi}}
+ key: NDK-${{matrix.os}}-eigen-3.4.0
- name: Download Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 6b538ca..7d968e5 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -86,11 +86,23 @@
libcusparse-dev-13-3
echo "CUDACXX=/usr/local/cuda-13.3/bin/nvcc" >> $GITHUB_ENV
- - name: Setup cuDSS
+ - name: Cache cuDSS
if: matrix.gpu == 'cuda'
+ id: cache-cudss
+ uses: actions/cache@v4
+ with:
+ path: libcudss-linux-x86_64-${{matrix.cudss}}-archive/
+ key: ${{matrix.os}}-cudss-${{matrix.cudss}}
+
+ - name: Setup cuDSS
+ if: matrix.gpu == 'cuda' && steps.cache-cudss.outputs.cache-hit != 'true'
run: |
wget https://developer.download.nvidia.com/compute/cudss/redist/libcudss/linux-x86_64/libcudss-linux-x86_64-${{matrix.cudss}}-archive.tar.xz
tar -xf libcudss-linux-x86_64-${{matrix.cudss}}-archive.tar.xz
+
+ - name: Setup cuDSS Environment
+ if: matrix.gpu == 'cuda'
+ run: |
echo "cudss_DIR=${{github.workspace}}/libcudss-linux-x86_64-${{matrix.cudss}}-archive/lib/cmake/cudss" >> $GITHUB_ENV
- name: Cache Mold
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index be7bb5a..b7cb6a3 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -12,6 +12,8 @@
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CMAKE_GENERATOR: Ninja
+ HOMEBREW_NO_AUTO_UPDATE: 1
+ HOMEBREW_NO_INSTALL_CLEANUP: 1
strategy:
fail-fast: true
matrix:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index f704783..0160983 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -88,6 +88,7 @@
run:
shell: powershell
env:
+ CCACHE_DIR: ${{github.workspace}}/ccache
CL: /MP
CMAKE_GENERATOR: ${{matrix.generator}}
CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}}
@@ -211,6 +212,29 @@
run: |
echo '${{github.workspace}}\suitesparse\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ - name: Cache ccache binary
+ id: cache-ccache-bin
+ uses: actions/cache@v4
+ with:
+ path: ccache-4.10.2-windows-x86_64/
+ key: ${{runner.os}}-ccache-bin-4.10.2
+
+ - name: Download ccache
+ if: steps.cache-ccache-bin.outputs.cache-hit != 'true'
+ run: |
+ Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-windows-x86_64.zip -OutFile ccache.zip
+ Expand-Archive -Path ccache.zip -DestinationPath .
+ Copy-Item ccache-4.10.2-windows-x86_64/ccache.exe ccache-4.10.2-windows-x86_64/cl.exe
+ Remove-Item ccache.zip
+
+ - name: Cache Build
+ id: cache-build
+ uses: actions/cache@v4
+ with:
+ path: ${{env.CCACHE_DIR}}
+ key: ${{runner.os}}-${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.gpu}}-ccache-${{github.run_id}}
+ restore-keys: ${{runner.os}}-${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.gpu}}-ccache-
+
- name: Configure
run: |
cmake -S . -B build_${{matrix.build_type}}/ `
@@ -218,6 +242,7 @@
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} `
-DCMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} `
-DCMAKE_INSTALL_PREFIX:PATH=${{github.workspace}}/install `
+ -DCMAKE_VS_GLOBALS="CLToolExe=cl.exe;CLToolPath=${{github.workspace}}/ccache-4.10.2-windows-x86_64;TrackFileAccess=false;UseMultiToolTask=true" `
-DLAPACK_lapack_LIBRARY=${{github.workspace}}/suitesparse/lib/liblapack.lib `
-DWITH_SUITESPARSE=ON