Skip to content

Commit

Permalink
Update circle CI config and common-go.mk to align with common_makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkaczynski-pantheon committed Jun 4, 2024
1 parent 2b632b9 commit 0efd4fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- restore-go-mod-cache
- run:
name: lint and test
command: make test-circle
command: make test-circle && make test-coverage
- run:
name: Upload Coverage Results to Codacy
command: |
Expand Down
25 changes: 14 additions & 11 deletions devops/make/common-go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ deps:: deps-go
deps-circle:: deps-circle-go deps
lint:: lint-go
test:: lint-go test-go-tparse
test-circle:: test-coverage-go test
test-circle:: test
test-coverage:: test-coverage-go
build:: $(APP)
build-go:: $(APP)
clean:: clean-go
format:: format-go

ifndef GOLINT_ARGS
GOLINT_ARGS := -v --timeout 3m
Expand Down Expand Up @@ -69,9 +70,17 @@ deps-go:: deps-lint ## install dependencies for project assumes you have go bina
ifneq (,$(wildcard vendor))
@find ./vendor/* -maxdepth 0 -type d -exec rm -rf "{}" \; || true
endif
$(call INFO, "restoring dependencies using modules via: go get $(GO_GET_ARGS)")
@GO111MODULE=on go get $(GO_GET_ARGS)

$(call INFO, "restoring dependencies using modules via: go mod download $(GO_GET_ARGS)")
@GO111MODULE=on go mod download $(GO_GET_ARGS)

format-go:
$(call INFO, "cleaning up go.mod")
@go mod tidy
$(call INFO, "formatting go-code")
@go fmt
$(call INFO, "running golangci-lint with fixes")
@# TODO: call lint-go
@golangci-lint run -E goimports --fix $(GOLINT_ARGS)

lint-go:: deps-go deps-lint
$(call INFO, "scanning source with golangci-lint")
Expand Down Expand Up @@ -108,12 +117,6 @@ else
endif
endif

deps-coveralls-go:: ## install goveralls for sending go test coverage reports to Coveralls.io
ifeq (, $(shell command -v goveralls;))
$(call INFO, "installing goveralls")
@GO111MODULE=off go get github.com/mattn/goveralls > /dev/null
endif

deps-status:: ## check status of deps with gostatus
ifeq (, $(shell command -v gostatus;))
$(call INFO, "installing gostatus")
Expand Down Expand Up @@ -144,5 +147,5 @@ ifdef FETCH_CA_CERT
@curl -s -L https://curl.haxx.se/ca/cacert.pem -o ca-certificates.crt > /dev/null
endif

.PHONY:: _fetch-cert test-coverage-html test-coveralls deps-status deps-coveralls-go deps-circle deps-go deps-lint \
.PHONY:: _fetch-cert test-coverage-html deps-status deps-circle deps-go deps-lint \
lint-go test-circle test-go build-circle build-linux build-go clean-go

0 comments on commit 0efd4fb

Please sign in to comment.