From 9b3b29cb9c7017554f7cc87a781472202d19b377 Mon Sep 17 00:00:00 2001 From: Christian Stewart Date: Fri, 21 Jun 2024 16:06:17 -0700 Subject: [PATCH] fix: use better caching keys for github actions Signed-off-by: Christian Stewart --- .github/workflows/buildroot-e2e.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/buildroot-e2e.yml b/.github/workflows/buildroot-e2e.yml index 68b719ac..9671c9ad 100644 --- a/.github/workflows/buildroot-e2e.yml +++ b/.github/workflows/buildroot-e2e.yml @@ -25,27 +25,12 @@ jobs: - name: Cache build cache and downloads uses: actions/cache@v4 - env: - cache-name: cache-buildroot with: path: ~/br-cache/ - key: ${{ runner.os }}-build-${{ env.cache-name }} - - - name: Clear caches if necessary - run: | - # necessary to save space - if [ ! -f ~/br-cache/ccache-v1 ]; then - echo "Clearing old compiler cache..." - rm -rf ~/br-cache/ccache* || true - mkdir -p ~/br-cache/ccache - touch ~/br-cache/ccache-v1 - fi - if [ ! -f ~/br-cache/dl-v1 ]; then - echo "Clearing old downloads cache..." - rm -rf ~/br-cache/dl* || true - mkdir -p ~/br-cache/dl - touch ~/br-cache/dl-v1 - fi + # https://github.com/actions/toolkit/issues/505#issuecomment-1650290249 + key: buildroot-r1-h${{ hashFiles('buildroot/Makefile') }} + restore-keys: | + buildroot - name: Install buildroot apt deps run: |