Skip to content

Commit 8ae1ad7

Browse files
authored
Merge pull request #8192 from adrianmoisey/fix-github-action-caching
Fix the setup-go Github action caching
2 parents c0443a7 + 4c154a7 commit 8ae1ad7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ jobs:
1515
test-and-verify:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: Set up Go
19-
uses: actions/[email protected]
20-
with:
21-
go-version: '1.22.2'
22-
2318
- uses: actions/[email protected]
2419
with:
2520
path: ${{ env.GOPATH }}/src/k8s.io/autoscaler
2621

22+
- name: Set up Go
23+
uses: actions/[email protected]
24+
with:
25+
go-version: '1.24.0'
26+
cache-dependency-path: |
27+
${{ env.GOPATH}}/src/k8s.io/autoscaler/cluster-autoscaler/go.sum
28+
${{ env.GOPATH}}/src/k8s.io/autoscaler/vertical-pod-autoscaler/go.sum
29+
${{ env.GOPATH}}/src/k8s.io/autoscaler/vertical-pod-autoscaler/e2e/go.sum
30+
2731
- name: Apt-get
2832
run: sudo apt-get install libseccomp-dev -qq
2933

hack/for-go-proj.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ for project_name in ${PROJECT_NAMES[*]}; do
5252
if [[ -n $(find . -name "Godeps.json") ]]; then
5353
godep go test -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e)
5454
else
55-
go test -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e | grep -v cluster-autoscaler/apis)
55+
go test -count=1 -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e | grep -v cluster-autoscaler/apis)
5656
fi
5757
;;
5858
*)
@@ -71,6 +71,6 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then
7171
# Default analyzers that go test runs according to https://github.com/golang/go/blob/52624e533fe52329da5ba6ebb9c37712048168e0/src/cmd/go/internal/test/test.go#L649
7272
# This doesn't include the `printf` analyzer until cluster-autoscaler libraries are updated.
7373
ANALYZERS="atomic,bool,buildtags,directive,errorsas,ifaceassert,nilfunc,slog,stringintconv,tests"
74-
go test ./... -vet="${ANALYZERS}"
74+
go test -count=1 ./... -vet="${ANALYZERS}"
7575
popd
7676
fi

0 commit comments

Comments
 (0)