From 157c30575302b6be890d6d4fceed005e32b840f6 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 23 Dec 2024 14:55:35 -0500 Subject: [PATCH] chore: Install tools if cache restore fails (#5394) On occasion, the cache restore fails, causing the test pipeline to fail due to not having tparse. This adds a failsafe in the event that there's something wrong with the cache restore. --- .github/workflows/test-race.yml | 6 ++++++ .github/workflows/test.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/test-race.yml b/.github/workflows/test-race.yml index 127e63bf47..98ea6eb883 100644 --- a/.github/workflows/test-race.yml +++ b/.github/workflows/test-race.yml @@ -132,6 +132,7 @@ jobs: go-version: "${{ needs.setup.outputs.go-version }}" cache: false - name: Set up Go modules cache + id: go-cache uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: | @@ -142,6 +143,11 @@ jobs: restore-keys: | ${{ runner.os }}-go fail-on-cache-miss: false + - name: Install tools if cache restore fails + if: steps.go-cache.outputs.cache-hit != 'true' + run: | + go mod download + make tools - name: Set up plugin cache id: plugin-cache uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b7cc89c54..dc53b0e0f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,6 +132,7 @@ jobs: go-version: "${{ needs.setup.outputs.go-version }}" cache: false - name: Set up Go modules cache + id: go-cache uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: | @@ -142,6 +143,11 @@ jobs: restore-keys: | ${{ runner.os }}-go fail-on-cache-miss: false + - name: Install tools if cache restore fails + if: steps.go-cache.outputs.cache-hit != 'true' + run: | + go mod download + make tools - name: Set up plugin cache id: plugin-cache uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2