Skip to content

Commit b03c439

Browse files
author
tazhate
committed
fix(ci): use explicit GOPATH/bin path for setup-envtest in test workflow
1 parent 9a592a8 commit b03c439

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
with:
1818
go-version-file: go.mod
1919

20-
- name: Download setup-envtest
21-
run: |
22-
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
23-
setup-envtest use --bin-dir ./bin/k8s -p path
20+
- name: Install setup-envtest
21+
run: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
2422

2523
- name: Running Tests
2624
run: |
2725
go mod tidy
28-
KUBEBUILDER_ASSETS="$(setup-envtest use --bin-dir ./bin/k8s -p path)" \
29-
go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
26+
K8S_VERSION=$(go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $3}')
27+
KUBEBUILDER_ASSETS="$($(go env GOPATH)/bin/setup-envtest use ${K8S_VERSION} --bin-dir $(pwd)/bin/k8s -p path)"
28+
export KUBEBUILDER_ASSETS
29+
go test $(go list ./... | grep -v /e2e) -coverprofile cover.out

0 commit comments

Comments
 (0)