diff --git a/.github/workflows/golang.yaml b/.github/workflows/golang.yaml index 882f119c..94820214 100644 --- a/.github/workflows/golang.yaml +++ b/.github/workflows/golang.yaml @@ -40,11 +40,16 @@ jobs: args: -v --timeout 5m skip-cache: true - - name: Check golang modules + - name: Golang modules run: | make check-modules make -C deployments/devel check-modules + - name: Generated code + run: | + make -C deployments/devel install-tools + make check-generate + test: name: Unit test runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 34d7b0a9..800e1187 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/)))) CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS)) -CHECK_TARGETS := golangci-lint +CHECK_TARGETS := golangci-lint check-generate MAKE_TARGETS := binaries build build-image check fmt lint-internal test examples cmds coverage generate vendor check-modules $(CHECK_TARGETS) TARGETS := $(MAKE_TARGETS) $(CMD_TARGETS) @@ -113,6 +113,9 @@ generate-crds: generate-deepcopy .remove-crds rm -rf $(CURDIR)/deployments/helm/tmp_crds +check-generate: generate + git diff --exit-code HEAD + generate-deepcopy: .remove-deepcopy for dir in $(DEEPCOPY_SOURCES); do \ controller-gen \