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.
This commit is contained in:
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -378,11 +378,14 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
||||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
|
||||||
CCACHE_DIR: $HOME/.ccache
|
|
||||||
run: |
|
run: |
|
||||||
Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan
|
Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan
|
||||||
|
|
||||||
|
# Set up ccache directories for Windows
|
||||||
if (Get-Command ccache -ErrorAction SilentlyContinue) {
|
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
|
ccache --zero-stats
|
||||||
}
|
}
|
||||||
if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) {
|
if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) {
|
||||||
|
|||||||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -388,12 +388,14 @@ jobs:
|
|||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
id: configure_windows
|
id: configure_windows
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
|
||||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
|
||||||
CCACHE_DIR: $HOME/.ccache
|
|
||||||
run: |
|
run: |
|
||||||
Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan
|
Write-Host "::group::CMake Configuration (Windows)" -ForegroundColor Cyan
|
||||||
|
|
||||||
|
# Set up ccache directories for Windows
|
||||||
if (Get-Command ccache -ErrorAction SilentlyContinue) {
|
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
|
ccache --zero-stats
|
||||||
}
|
}
|
||||||
if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) {
|
if (-not $env:CMAKE_TOOLCHAIN_FILE -or -not (Test-Path $env:CMAKE_TOOLCHAIN_FILE)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user