From 7c66b7405ab53afd317d2592b042ebbbf754cd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 5 Apr 2023 21:39:45 +0200 Subject: [PATCH] Add (make tools) to install (for now only) golangci-lint, use it in Cirrus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- .cirrus.yml | 7 ++++--- Makefile | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9375737f..754a0792 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -52,8 +52,9 @@ validate_task: image: '${SKOPEO_CIDEV_CONTAINER_FQIN}' cpu: 4 memory: 8 - script: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2 + setup_script: | + make tools + test_script: | make validate-local make vendor && hack/tree_status.sh @@ -92,7 +93,7 @@ osx_task: export PATH=$GOPATH/bin:$PATH brew update brew install gpgme go go-md2man - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2 + make tools test_script: | export PATH=$GOPATH/bin:$PATH go version diff --git a/Makefile b/Makefile index d9f92581..46aa4d29 100644 --- a/Makefile +++ b/Makefile @@ -181,6 +181,11 @@ install-completions: completions shell: $(CONTAINER_RUN) bash +tools: + if [ ! -x "$(GOBIN)/golangci-lint" ]; then \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.52.2 ; \ + fi + check: validate test-unit test-integration test-system test-integration: