From 02112928ec85ffdb53c631fa5d20eef1adff1ea1 Mon Sep 17 00:00:00 2001 From: tequ Date: Thu, 27 Nov 2025 01:40:00 +0900 Subject: [PATCH] add `cache_enabled` option to xahau-ga-build --- .github/actions/xahau-ga-build/action.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/xahau-ga-build/action.yml b/.github/actions/xahau-ga-build/action.yml index c522fff79..232709f74 100644 --- a/.github/actions/xahau-ga-build/action.yml +++ b/.github/actions/xahau-ga-build/action.yml @@ -28,6 +28,10 @@ inputs: description: 'Cache version for invalidation' required: false default: '1' + cache_enabled: + description: 'Whether to use cache' + required: false + default: 'true' ccache_enabled: description: 'Whether to use ccache' required: false @@ -72,7 +76,7 @@ runs: echo "name=${SAFE_BRANCH}" >> $GITHUB_OUTPUT - name: Restore ccache directory for main branch - if: inputs.ccache_enabled == 'true' + if: inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' id: ccache-restore uses: ./.github/actions/xahau-ga-cache-restore with: @@ -84,7 +88,7 @@ runs: cache-type: ccache-main - name: Restore ccache directory for current branch - if: inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch + if: inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch id: ccache-restore-current-branch uses: ./.github/actions/xahau-ga-cache-restore with: @@ -237,14 +241,14 @@ runs: run: ccache -s - name: Save ccache directory for main branch - if: success() && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name == inputs.main_branch + if: success() && inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name == inputs.main_branch uses: actions/cache/save@v4 with: path: ~/.ccache-main key: ${{ steps.ccache-restore.outputs.cache-primary-key }} - name: Save ccache directory for current branch - if: success() && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch + if: success() && inputs.cache_enabled == 'true' && inputs.ccache_enabled == 'true' && steps.safe-branch.outputs.name != inputs.main_branch uses: actions/cache/save@v4 with: path: ~/.ccache-current