From 9e91714501e5c778bdd0f2c2ee24596e27985163 Mon Sep 17 00:00:00 2001 From: Shwetha K Acharya Date: Tue, 25 Jul 2023 16:13:28 +0530 Subject: [PATCH] CI: upgrade to setup-go v4 and disable cache with golangci Below errors were seen with setup-go@v4 in golangci Lint: Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/yaml_ test.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/LICENSE: Cannot open: File exists Disabling Cache with golangci solves the problem and makes sure that we are in a reecent setup-go as well. Cache can be enabled once the resultant issue is fixed in golangci lint action repo. Issue that is to be tracked: https://github.com/golangci/golangci-lint-action/issues/135 Updates: #1000 Signed-off-by: Shwetha K Acharya --- .github/workflows/ci.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 28a546128..1c49f4dd4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,7 +31,6 @@ defaults: run: shell: bash jobs: - lint: name: Linters runs-on: ubuntu-20.04 @@ -66,9 +65,16 @@ jobs: uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: + # when the files to be extracted are already present, + # tar extraction in Golangci Lint fails with the "File exists" + # errors. These files appear to be present because of + # cache in setup-go, on disabling the cache we are no more seeing + # such error. Cache is to be enabled once the fix is available for + # this issue. go-version: ${{ env.GO_VERSION }} + cache: false - name: GolangCI Lint uses: golangci/golangci-lint-action@v3 @@ -83,7 +89,7 @@ jobs: uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} @@ -189,7 +195,7 @@ jobs: uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} @@ -228,7 +234,7 @@ jobs: uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} @@ -342,7 +348,7 @@ jobs: uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }}