refactor(go): remove redundant caching from Go actions

Remove redundant common-cache usage in Go actions since setup-go with
cache:true already provides comprehensive caching.

Changes:
- go-build: Removed duplicate common-cache step (setup-go caches
  ~/go/pkg/mod and ~/.cache/go-build automatically)
- go-lint: Removed redundant ~/.cache/go-build from cache paths
  (kept ~/.cache/golangci-lint as it's linter-specific and not
  covered by setup-go)

Performance improvements:
- Eliminates duplicate caching operations
- Reduces action initialization overhead
- setup-go's native caching is more efficient and maintained

setup-go with cache:true caches:
- ~/go/pkg/mod (Go modules)
- ~/.cache/go-build (Go build cache)
This commit is contained in:
2025-11-20 11:23:53 +02:00
parent ec044d16c0
commit 5ab6f03264
3 changed files with 3 additions and 13 deletions

View File

@@ -164,17 +164,7 @@ runs:
go-version: ${{ steps.detect-go-version.outputs.detected-version }} go-version: ${{ steps.detect-go-version.outputs.detected-version }}
cache: true cache: true
- name: Cache Go Dependencies
id: cache-go
uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42
with:
type: 'go'
paths: '~/go/pkg/mod'
key-files: 'go.mod,go.sum'
key-prefix: 'go-build'
- name: Download Dependencies - name: Download Dependencies
if: steps.cache-go.outputs.cache-hit != 'true'
uses: step-security/retry@e1d59ce1f574b32f0915e3a8df055cfe9f99be5d # v3 uses: step-security/retry@e1d59ce1f574b32f0915e3a8df055cfe9f99be5d # v3
with: with:
timeout_minutes: 10 timeout_minutes: 10

View File

@@ -215,13 +215,13 @@ runs:
with: with:
token: ${{ inputs.token || github.token }} token: ${{ inputs.token || github.token }}
- name: Set up Cache - name: Cache golangci-lint
id: cache id: cache
if: inputs.cache == 'true' if: inputs.cache == 'true'
uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42
with: with:
type: 'go' type: 'go'
paths: '~/.cache/golangci-lint,~/.cache/go-build' paths: '~/.cache/golangci-lint'
key-prefix: 'golangci-${{ inputs.golangci-lint-version }}' key-prefix: 'golangci-${{ inputs.golangci-lint-version }}'
key-files: 'go.sum,${{ inputs.config-file }}' key-files: 'go.sum,${{ inputs.config-file }}'
restore-keys: '${{ runner.os }}-golangci-${{ inputs.golangci-lint-version }}-' restore-keys: '${{ runner.os }}-golangci-${{ inputs.golangci-lint-version }}-'

View File

@@ -28,7 +28,7 @@ This action is a `composite` action.
### Usage ### Usage
```yaml ```yaml
- uses: ivuorinen/actions/language-version-detect@v2025 - uses: ivuorinen/actions/language-version-detect@main
with: with:
language: language:
# Language to detect version for (php, python, go, dotnet) # Language to detect version for (php, python, go, dotnet)