-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathaction.yaml
30 lines (30 loc) · 1.34 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: InstallDependencies
description: 'Installs Go Downloads and installs Karpenter Dependencies'
inputs:
k8sVersion:
description: Kubernetes version to use when installing the toolchain
default: "1.24.x"
runs:
using: "composite"
steps:
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
id: setup-go
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: "**/go.sum"
# Root path permission workaround for caching https://github.com/actions/cache/issues/845#issuecomment-1252594999
- run: sudo chown "$USER" /usr/local
shell: bash
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
id: cache-toolchain
with:
path: |
/usr/local/kubebuilder/bin
~/go/bin
# Added go version to compensate for this issue with govulncheck: https://github.com/golang/go/issues/65590. Could re-evaluate if this is necessary once the
# upstream go issue is corrected and if this is causing too many cache misses.
key: ${{ runner.os }}-${{ inputs.k8sVersion }}-${{ steps.setup-go.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