From 4886bf95fcf6e7f38f48a346f4112fe340a453c8 Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Tue, 2 Sep 2025 23:26:41 -0700 Subject: manually config ccache locally (#8351) This avoids uploading the ccache to github and take the cache storage. --------- Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- .github/actions/common-setup/action.yml | 48 ++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 13 deletions(-) (limited to '.github/actions') diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index bf6174c75..f2e9567dd 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -118,17 +118,39 @@ runs: linux*) echo "${{github.workspace}}/external/slang-binaries/spirv-tools/$(uname -m)-linux/bin" >> "$GITHUB_PATH";; esac - # Setup ccache for self-hosted runners (Windows only for now) - - name: Setup ccache + # Setup ccache for local compilation speedup (Windows self-hosted only) + # Only use ccache if already installed - don't attempt installation + - name: Setup ccache (if available, local only, no GitHub uploads) if: ${{ inputs.os == 'windows' && runner.environment == 'self-hosted' }} - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - install_ccache: true - prepend_symlinks_to_path: true - windows_compile_environment: msvc - ccache_options: | - max_size=2G - compression=true - compression_level=6 - sloppiness=pch_defines,time_macros + shell: bash + run: | + # Check if ccache is available + if ! command -v ccache &> /dev/null; then + echo "⚠️ ccache not found on this self-hosted runner" + echo " Skipping ccache setup to avoid permission issues" + echo " Build will proceed without ccache acceleration" + echo " To enable ccache: manually install it on the runner with admin rights" + exit 0 + fi + + echo "✅ ccache found on self-hosted runner - setting up local caching" + + # Set ccache directory (local temp directory) + ccache_dir="${{ github.workspace }}/.ccache-local" + mkdir -p "$ccache_dir" + echo "CCACHE_DIR=$ccache_dir" >> $GITHUB_ENV + + # Configure ccache settings for local use only + ccache --set-config=max_size=2G + ccache --set-config=compression=true + ccache --set-config=compression_level=6 + ccache --set-config=sloppiness=pch_defines,time_macros + + # Enable ccache for CMake (set environment variables) + echo "ccache_symlinks_path=ccache" >> $GITHUB_ENV + + # Show initial stats + echo "ccache configuration:" + ccache --show-config || echo "Could not show ccache config" + ccache --zero-stats || echo "Could not zero ccache stats" + ccache --show-stats || echo "Could not show ccache stats" -- cgit v1.2.3