From 433729fe531b55af028e44e1e10e57df24be21e6 Mon Sep 17 00:00:00 2001 From: tequ Date: Thu, 4 Dec 2025 20:21:10 +0900 Subject: [PATCH] Refactor ccache configuration to use a unified cache directory. --- .github/actions/xahau-ga-build/action.yml | 19 ++++--------------- .github/workflows/xahau-ga-nix.yml | 3 +-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/actions/xahau-ga-build/action.yml b/.github/actions/xahau-ga-build/action.yml index 2b025e650..3d06e7115 100644 --- a/.github/actions/xahau-ga-build/action.yml +++ b/.github/actions/xahau-ga-build/action.yml @@ -76,7 +76,7 @@ runs: shell: bash run: | # Create cache directories - mkdir -p ~/.ccache-main ~/.ccache-current + mkdir -p ~/.ccache-cache # Keep config separate from cache_dir so configs aren't swapped when CCACHE_DIR changes between steps mkdir -p ~/.config/ccache @@ -87,20 +87,9 @@ runs: ccache --set-config=max_size=${{ inputs.ccache_max_size }} ccache --set-config=hash_dir=${{ inputs.ccache_hash_dir }} ccache --set-config=compiler_check=${{ inputs.ccache_compiler_check }} - - # Determine if we're on the main branch - if [ "${{ steps.safe-branch.outputs.name }}" = "${{ inputs.main_branch }}" ]; then - # Main branch: use main branch cache only - ccache --set-config=cache_dir="$HOME/.ccache-main" - echo "CCACHE_DIR=$HOME/.ccache-main" >> $GITHUB_ENV - echo "📦 Main branch: using ~/.ccache-main" - else - # Feature branch: use current branch cache with main as secondary (read-only fallback) - ccache --set-config=cache_dir="$HOME/.ccache-current" - ccache --set-config=secondary_storage="file:$HOME/.ccache-main" - echo "CCACHE_DIR=$HOME/.ccache-current" >> $GITHUB_ENV - echo "📦 Feature branch: using ~/.ccache-current with ~/.ccache-main as secondary" - fi + ccache --set-config=cache_dir="$HOME/.ccache-cache" + echo "CCACHE_DIR=$HOME/.ccache-cache" >> $GITHUB_ENV + echo "📦 using ~/.ccache-cache as ccache cache directory" # Print config for verification echo "=== ccache configuration ===" diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index a65133738..d25ee1cec 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -181,8 +181,7 @@ jobs: image: ubuntu:24.04 volumes: - /home/runner/.conan-cache:/.conan-cache - - /home/runner/.ccache-main:/github/home/.ccache-main - - /home/runner/.ccache-current:/github/home/.ccache-current + - /home/runner/.ccache-cache:/github/home/.ccache-cache defaults: run: shell: bash