Fix make test on arm64 runners

The environment variables set at the Makefile were causing go install to
yield a corrupted file for setup-envtest. To fix the issue, such operation
is now always executed in a clean bash.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
This commit is contained in:
Paulo Gomes 2022-02-09 11:33:34 +00:00
parent e5d032fe9c
commit 514126c4b8
No known key found for this signature in database
GPG Key ID: 9995233870E99BEE
2 changed files with 2 additions and 6 deletions

View File

@ -57,11 +57,7 @@ jobs:
with:
go-version: 1.17.x
- name: Run tests
run: |
mkdir tmp-download; cd tmp-download; go mod init go-download;
GOBIN="${GITHUB_WORKSPACE}/build/gobin" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
cd ..; rm -rf tmp-download
make test
run: make test
- name: Prepare
id: prep
run: |

View File

@ -224,7 +224,7 @@ TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
go install $(2) ;\
env -i bash -c "GOBIN=$(GOBIN) PATH=$(PATH) GOPATH=$(shell go env GOPATH) GOCACHE=$(shell go env GOCACHE) go install $(2)" ;\
rm -rf $$TMP_DIR ;\
}
endef