Skip to content

Commit

Permalink
fix: use actions/cache for all caching needs
Browse files Browse the repository at this point in the history
Due to how you cannot pass in a cache key to actions/go-setup, we cannot
reliably use the cache produced by this action. See issue for more info:
actions/setup-go#358
  • Loading branch information
fredrikaverpil committed Aug 16, 2024
1 parent 4774ed3 commit 52e232c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ inputs:
required: false
default: '1.22'

cache-dependency-path:
description: Path to the go.sum file(s) to use in caching.
required: false
default: go.sum

check-latest:
description: If true, checks whether the cached go version is the latest, if not then downloads the latest. Useful when you need to use the latest version.
required: false
Expand All @@ -46,8 +41,7 @@ runs:
with:
go-version: ${{ inputs.go-version }}
check-latest: ${{ inputs.check-latest }}
cache: ${{ inputs.disableCache != 'true' }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
cache: false # cache is handled by separate actions/cache step.

- name: Cache sage folders
if: ${{ inputs.disableCache != 'true' }}
Expand All @@ -56,6 +50,9 @@ runs:
path: |
./.sage/tools
./.sage/bin
/home/runner/.cache/go-build
/home/runner/go/pkg/mod
/home/runner/go/bin
key: ${{ runner.os }}-sage-${{ github.workflow }}-${{ github.job }}-${{ inputs.cacheKey }}-${{ inputs.go-version }}-${{ hashFiles('./.sage/go.sum') }}
restore-keys: |
${{ runner.os }}-sage-${{ github.workflow }}-${{ github.job }}-${{ inputs.cacheKey }}-${{ inputs.go-version }}-
Expand Down

0 comments on commit 52e232c

Please sign in to comment.