From 6fc986e34b50892a701618f0dc8a8d75a5eff520 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 5 Jul 2024 00:08:04 +0900 Subject: [PATCH] feat(ci): save cache on `no-cuda` jobs and restore cache only on `cuda` jobs (#4945) --- .github/actions/docker-build/action.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 84523983a0a..147a1a75cf5 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -35,7 +35,8 @@ runs: shell: bash - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 + if: ${{ inputs.name == 'no-cuda' }} id: cache with: path: | @@ -45,8 +46,19 @@ runs: cache-${{ inputs.platform }}-${{ inputs.name }}- cache-${{ inputs.platform }}- + - name: Restore cache + uses: actions/cache/restore@v4 + if: ${{ inputs.name != 'no-cuda' }} + with: + path: | + root-ccache + key: cache-${{ matrix.platform }}-${{ matrix.name }}-${{ hashFiles('autoware.repos') }} + restore-keys: | + cache-${{ matrix.platform }}-${{ matrix.name }}- + cache-${{ matrix.platform }}- + - name: Inject cache into docker - uses: reproducible-containers/buildkit-cache-dance@v3.1.0 + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 with: cache-map: | {