From 40206717ac742994e6f46b1b7428dfccd604d5d6 Mon Sep 17 00:00:00 2001 From: Ivo Jimenez Date: Sun, 31 Oct 2021 17:43:54 -0700 Subject: [PATCH] gha: fix ccache key for redpanda workflow Use git ref as part of the key and remove timestamp. The current limit from Github is 5GB for all cached files across a repository. With this change, there is only one ccache file uploaded per branch, instead of one for each distinct build. This results in having one for the main branch, as well as one per PR. Signed-off-by: Ivo Jimenez --- .github/workflows/redpanda-build.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/redpanda-build.yml b/.github/workflows/redpanda-build.yml index 30614f76ac08b..bcd856e9fc05a 100644 --- a/.github/workflows/redpanda-build.yml +++ b/.github/workflows/redpanda-build.yml @@ -31,23 +31,13 @@ jobs: . rm .dockerignore - # there is no analog to ${{ github.workspace }} for the home directory - - name: prepare cache variables - id: prepare_cache_variables - run: | - echo ::set-output name=home::$HOME - echo ::set-output name=timestamp::$(date +'%Y-%m-%d-%H-%M-%S') - - name: ccache cache files uses: actions/cache@v2 with: - path: ${{ steps.prepare_cache_variables.outputs.home }}/.ccache - key: ${{ matrix.container }}-ccache-${{ steps.prepare_cache_variables.outputs.timestamp }} - restore-keys: ${{ matrix.container }}-ccache- + path: /dev/shm/redpanda + key: ccache-${{github.ref}} + restore-keys: ccache - # at the time of this writing the ccache for a full build is about - # 70MB (due to the compression) but it may grow if there are many - # commits with changes within 1 branch and thus the 200MB upper limit - name: build & test run: | export CCACHE_COMPRESS=true