Skip to content

Commit

Permalink
CI: upgrade to setup-go v4 and disable cache with golangci
Browse files Browse the repository at this point in the history
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:
golangci/golangci-lint-action#135

Updates: #1000
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
  • Loading branch information
Shwetha-Acharya authored and nirs committed Jul 27, 2023
1 parent fbc13da commit 9e91714
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yaml
Expand Up @@ -31,7 +31,6 @@ defaults:
run:
shell: bash
jobs:

lint:
name: Linters
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -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
Expand All @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down

0 comments on commit 9e91714

Please sign in to comment.