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 033be02
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 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,16 +41,18 @@ 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
- name: Set up cache
if: ${{ inputs.disableCache != 'true' }}
uses: actions/cache@v4
with:
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 033be02

Please sign in to comment.