From 9f65a8a961e11e38e03fc83ca605b936b03bced4 Mon Sep 17 00:00:00 2001 From: Ashay Rane Date: Thu, 25 May 2023 11:01:46 -0500 Subject: [PATCH] CI: disable caching for release builds (#2168) This patch adds a (default-true) input called `cache-enabled` to the setup-build action, so that when the input is false, ccache is not setup on the host machine. This patch also sets the input to be false for the release builds. --- .github/actions/setup-build/action.yml | 6 ++++++ .github/workflows/buildRelease.yml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 85c3f7516..efbd4702c 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -2,6 +2,10 @@ name: "Setup build environment" description: "Setup the build environment. An action so that it can be shared between in-tree/out-of-tree jobs" inputs: + cache-enabled: + required: true + default: true + cache-suffix: description: | Additional string that is used to compute the ccache hash. @@ -48,6 +52,7 @@ runs: shell: bash - name: Configure ccache + if: ${{ inputs.cache-enabled == 'true' }} run: | rm -rf ${{ github.workspace }}/.ccache mkdir -p ${{ github.workspace }}/.ccache @@ -58,6 +63,7 @@ runs: shell: bash - name: Enable ccache + if: ${{ inputs.cache-enabled == 'true' }} uses: actions/cache@v3 with: path: ${{ github.workspace }}/.ccache diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index d5ccc2fc4..a6e6a054b 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -40,7 +40,7 @@ jobs: - uses: ./.github/actions/setup-build with: - cache-suffix: 'release' + cache-enabled: 'false' - name: Build Python wheels and smoke test. run: | cd $GITHUB_WORKSPACE @@ -99,7 +99,7 @@ jobs: submodules: 'true' - uses: ./.github/actions/setup-build with: - cache-suffix: 'release' + cache-enabled: 'false' - name: Build Python wheels and smoke test. run: | cd $GITHUB_WORKSPACE @@ -159,7 +159,7 @@ jobs: submodules: 'true' - uses: ./.github/actions/setup-build with: - cache-suffix: 'release' + cache-enabled: 'false' - name: Set up Visual Studio shell uses: egor-tensin/vs-shell@v2 with: