From 42f6b34ac58e0539fb6cf8d38690786036b4f40d Mon Sep 17 00:00:00 2001 From: v4hn Date: Tue, 10 Sep 2024 16:01:16 +0200 Subject: [PATCH] support rerunning failed steps before, the reran step would fail to upload its cache in the end because a prior failed run already stored the cache key. --- .github/workflows/debs-from-repos.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/debs-from-repos.yaml b/.github/workflows/debs-from-repos.yaml index c1508cfe90..73a590dd4b 100644 --- a/.github/workflows/debs-from-repos.yaml +++ b/.github/workflows/debs-from-repos.yaml @@ -39,8 +39,16 @@ jobs: uses: actions/cache/restore@v4 with: path: /home/runner/apt_repo - key: apt-repo-${{ env.DEB_DISTRO }}-${{ env.ROS_DISTRO }}-${{ inputs.depends }}-${{ github.sha }}-${{ github.run_id }} - fail-on-cache-miss: true + key: apt-repo-${{ env.DEB_DISTRO }}-${{ env.ROS_DISTRO }}-${{ inputs.depends }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + apt-repo-${{ env.DEB_DISTRO }}-${{ env.ROS_DISTRO }}-${{ inputs.depends }}-${{ github.sha }}-${{ github.run_id }} + - name: Verify cache + if: ${{ inputs.depends }} + run: | + if [ -z "${{ steps.depends-cache.outputs.cache-hit }}" ]; then + echo "Cache not found" + exit 1 + fi - name: Use ccache uses: actions/cache/restore@v4 with: @@ -69,4 +77,4 @@ jobs: if: always() with: path: /home/runner/apt_repo - key: apt-repo-${{ env.DEB_DISTRO }}-${{ env.ROS_DISTRO }}-${{ inputs.repos }}-${{ github.sha }}-${{ github.run_id }} + key: apt-repo-${{ env.DEB_DISTRO }}-${{ env.ROS_DISTRO }}-${{ inputs.repos }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}