Skip to content

Commit

Permalink
ci: add go version to dep cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Mar 11, 2024
1 parent 1b873b5 commit a27d441
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/actions/install-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ runs:
# Root path permission workaround for caching https://github.com/actions/cache/issues/845#issuecomment-1252594999
- run: sudo chown "$USER" /usr/local
shell: bash
- id: get-go-version
shell: bash
run: |
go_version="$(go mod edit -json | jq ".Go")"
echo "go_version=${go_version}" >> $GITHUB_OUTPUT
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
id: cache-toolchain
with:
path: |
/usr/local/kubebuilder/bin
~/go/bin
key: ${{ runner.os }}-${{ inputs.k8sVersion }}-toolchain-cache-${{ hashFiles('hack/toolchain.sh') }}
key: ${{ runner.os }}-${{ inputs.k8sVersion }}-${{ steps.get-go-version.outputs.go_version }}-toolchain-cache-${{ hashFiles('hack/toolchain.sh') }}
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
shell: bash
run: K8S_VERSION=${{ inputs.k8sVersion }} make toolchain
run: K8S_VERSION=${{ inputs.k8sVersion }} make toolchain

0 comments on commit a27d441

Please sign in to comment.