From 977ed787857fa23a11327e35cf8de0fa02a6483f Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 14 Oct 2025 13:40:32 -0400 Subject: [PATCH] refactor(ci): update ccache setup in Windows workflows - Modified the CI and release workflows to set up ccache directories for Windows, improving build performance. - Ensured that the ccache environment variables are correctly initialized, enhancing caching efficiency. Benefits: - Streamlines the caching process in Windows environments, leading to faster build times and improved CI efficiency. --- .github/workflows/ci.yml | 7 +++++-- .github/workflows/release.yml | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb52ceaa..8026befb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -378,11 +378,14 @@ jobs: shell: pwsh env: VCPKG_DEFAULT_TRIPLET: x64-windows-static - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: $HOME/.ccache run: | Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan + + # Set up ccache directories for Windows if (Get-Command ccache -ErrorAction SilentlyContinue) { + $env:CCACHE_BASEDIR = "${{ github.workspace }}" + $env:CCACHE_DIR = Join-Path $env:USERPROFILE ".ccache" + Write-Host "CCACHE_DIR set to: $env:CCACHE_DIR" ccache --zero-stats } if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) { diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0805b3c..1cf389b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -388,12 +388,14 @@ jobs: if: runner.os == 'Windows' id: configure_windows shell: pwsh - env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: $HOME/.ccache run: | Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan + + # Set up ccache directories for Windows if (Get-Command ccache -ErrorAction SilentlyContinue) { + $env:CCACHE_BASEDIR = "${{ github.workspace }}" + $env:CCACHE_DIR = Join-Path $env:USERPROFILE ".ccache" + Write-Host "CCACHE_DIR set to: $env:CCACHE_DIR" ccache --zero-stats } if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) {