Skip to content

Commit

Permalink
gha: change ccache key for redpanda workflow
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ivotron committed Nov 1, 2021
1 parent e5a23ab commit 8d4a02a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/redpanda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d4a02a

Please sign in to comment.