Skip to content

Commit

Permalink
remove unnecassary caching of of golangci-lint
Browse files Browse the repository at this point in the history
golangci-lint step auto caches the binary. Explicit caching step is not needed anymore.
Refer to https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#internals

Of course, we could cache a specific version of golangci-lint instead of go.mod hash. But effort to create that logic
 outweighs its impact.
However, golangci-lint.cache-{runner_os}-{working_directory}-{interval_number}-{go.mod_hash} has its advantages; it updates
itself with go.mod changes.
We delete older caches using auto delete cache workflow.
  • Loading branch information
nawazkh committed Oct 7, 2024
1 parent 63ae05a commit 357bed3
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/pr-golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ jobs:
with:
go-version: ${{ steps.vars.outputs.go_version }}

- name: Cache golangci-lint binary
id: golangci-cache
uses: actions/cache@v4
with:
# Cache location used by golangci-lint-action
path: ~/.cache/golangci-lint
# Change this when updating golangci-lint version
key: golangci-lint-v1.60.2
restore-keys: |
golangci-lint-
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # tag=v6.1.1
with:
Expand Down

0 comments on commit 357bed3

Please sign in to comment.