From afd9785051459bbcabe3121cb3cd1f73f5be3b56 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Tue, 13 Jul 2021 15:14:38 -0300 Subject: [PATCH 1/2] makefile: Add static-checks target Added the 'static-checks' make target to allow developers to easily run the static checks locally. Fixes #2206 Signed-off-by: Wainer dos Santos Moschetta --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f536c9bcf3..a877f375b0 100644 --- a/Makefile +++ b/Makefile @@ -29,4 +29,8 @@ $(eval $(call create_all_rules,$(COMPONENTS),$(TOOLS),$(STANDARD_TARGETS))) generate-protocols: make -C src/agent generate-protocols -.PHONY: all default +# Some static checks rely on generated source files of components. +static-checks: build + bash ci/static-checks.sh + +.PHONY: all default static-checks From dcd2986724679e9ddee9e49c7d54d50711ab7476 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Wed, 14 Jul 2021 16:01:54 -0300 Subject: [PATCH 2/2] static-checks: Call the static-checks make target Instead of calling the ci/static-checks.sh script directly, it was changed the workflow to call `make static-checks`. And because the `static-checks` target depends on build, the build step in the workflow is not longer needed. Signed-off-by: Wainer dos Santos Moschetta --- .github/workflows/static-checks.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index b8337f6ebe..ce0ac2ef4c 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -63,13 +63,9 @@ jobs: - name: Check vendored code run: | cd ${GOPATH}/src/github.com/${{ github.repository }} && make vendor - # Must build before static checks as we depend on some generated code in runtime and agent - - name: Build - run: | - cd ${GOPATH}/src/github.com/${{ github.repository }} && make - name: Static Checks run: | - cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/static-checks.sh + cd ${GOPATH}/src/github.com/${{ github.repository }} && make static-checks - name: Run Compiler Checks run: | cd ${GOPATH}/src/github.com/${{ github.repository }} && make check