From be6a58240c16bfe4243a01a13e81a28e0bb231ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Naveiras?= Date: Thu, 15 Jun 2023 11:47:17 +0100 Subject: [PATCH] Update Makefile with new targets Aim to simplify the user experience while developing locally. Removed the GOARCH flag, so by default you're using your default ARCH. I think this will simpler for everyone, and reduce the amount of binaries to build. Added helpers to run the acceptance tests, maybe we can also use them in github actions --- .github/workflows/build-integration.yml | 22 ++--- Dockerfile | 3 +- Makefile | 92 +++++++++---------- README.md | 39 +++++--- .../vault/v1alpha1/secretsinjector_webhook.go | 6 +- apis/workloads/v1alpha1/helpers.go | 11 +-- 6 files changed, 91 insertions(+), 82 deletions(-) diff --git a/.github/workflows/build-integration.yml b/.github/workflows/build-integration.yml index 0f336b7f..eeb352cf 100644 --- a/.github/workflows/build-integration.yml +++ b/.github/workflows/build-integration.yml @@ -47,11 +47,7 @@ jobs: go-version: 1.20.5 - name: Ensure no go vet errors run: | - go vet ./cmd/rbac-manager/... - go vet ./cmd/theatre-consoles/... - go vet ./cmd/theatre-secrets/... - go vet ./cmd/vault-manager/... - go vet ./cmd/workloads-manager/... + make vet unit-integration: runs-on: ubuntu-latest @@ -60,15 +56,17 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.20.5 - - name: Install ginkgo test runner - run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5 + - name: Install go tooling and setup-envtest + run: | + make install-tools - name: Install Kubebuilder test helpers run: | sudo mkdir /usr/local/kubebuilder curl -fsL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz \ | sudo tar -xvz --strip=1 -C /usr/local/kubebuilder - name: Run tests - run: ginkgo -race -randomizeSuites -randomizeAllSpecs -r -v ./... + run: | + make test acceptance: runs-on: ubuntu-latest @@ -78,9 +76,7 @@ jobs: with: go-version: 1.20.5 - name: Build test binaries - run: make bin/acceptance.linux_amd64 - # This tools version don't change that often, it would be a good idea use actions/cache. - # maybe same thing with the toolling in the unit-integration + run: make bin/acceptance.linux - name: Install tooling run: |- sudo bash <