From a3f70cd771aff78df1b8740ed812bcaa43b00ba5 Mon Sep 17 00:00:00 2001 From: Bastian Krol Date: Wed, 15 May 2024 06:46:44 +0200 Subject: [PATCH] ci: add github action Also, update controller-gen from v0.13.0 to v0.14.0 to avoid https://github.com/kubernetes-sigs/controller-tools/issues/880. --- .github/workflows/verify.yaml | 56 +++++++++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify.yaml diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml new file mode 100644 index 0000000..aa78ced --- /dev/null +++ b/.github/workflows/verify.yaml @@ -0,0 +1,56 @@ +name: verify + +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + workflow_dispatch: + +jobs: + verify: + runs-on: ubuntu-latest + name: Build & Test + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/setup-go@v5 + with: + go-version: ~1.22 + cache: true + + - name: go version + run: | + go version + + - name: build + run: | + make + + - name: verify that generated code is up-to-date + run: | + # make (which we ran in the previous step) will implicitly also run the targets manifests & generate, which + # could potentially modify code that is under version control, if changes have been comitted that would have + # required updating manifests or generated code and these updates have not been done. + git diff --exit-code + + - name: lint + run: | + make lint + + - name: test + run: | + make test + + - name: build container image + run: | + make docker-build + + - name: end-to-end test + run: | + make test-e2e \ No newline at end of file diff --git a/Makefile b/Makefile index e3907f9..62add01 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions KUSTOMIZE_VERSION ?= v5.2.1 -CONTROLLER_TOOLS_VERSION ?= v0.13.0 +CONTROLLER_TOOLS_VERSION ?= v0.14.0 .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.