diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b182b96c8370ac7f2a17402751b79f972aef9ca..789426d97897cb59307c4d65d05df79c1ea4253f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,44 +23,50 @@ before_script: - export CC=clang-5.0 - - make dep + - go get -v -d ./... + + - export PROJECT_NAME="gitlab-runner-do-monitor" + - export PKG="git.ethitter.com/debian/${PROJECT_NAME}" + - export PKG_LIST=$(go list ${PKG}/... | grep -v /vendor/) unit_tests: stage: test script: - - make test + - go test -v ${PKG_LIST} race_detector: stage: test script: - - make race + - go test -v -race ${PKG_LIST} memory_sanitizer: stage: test script: - - make msan + - go test -v -msan ${PKG_LIST} code_coverage: stage: test script: - - make coverage + - ./tools/coverage.sh code_coverage_report: stage: test script: - - make coverhtml + - ./tools/coverage.sh html only: - master lint_code: stage: test script: - - make lint + - golint -set_exit_status ${PKG_LIST} build: stage: build + before_script: + - go get github.com/mitchellh/gox script: - - make + - gox -output="${CI_PROJECT_DIR}/${PROJECT_NAME}/{{.Dir}}_{{.OS}}_{{.Arch}}" -parallel=6 artifacts: paths: - gitlab-runner-do-monitor/ diff --git a/Makefile b/Makefile deleted file mode 100644 index f3d51f5ab64e20315838049f678937463ec70bf8..0000000000000000000000000000000000000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -PROJECT_NAME := "gitlab-runner-do-monitor" -PKG := "git.ethitter.com/debian/$(PROJECT_NAME)" -PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) -GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go) - -.PHONY: all dep build clean test coverage coverhtml lint - -all: build - -lint: - @golint -set_exit_status ${PKG_LIST} - -test: - @go test -v ${PKG_LIST} - -race: dep - @go test -v -race ${PKG_LIST} - -msan: dep - @go test -v -msan ${PKG_LIST} - -coverage: - ./tools/coverage.sh; - -coverhtml: - ./tools/coverage.sh html; - -dep: - @go get -v -d ./... - @go get github.com/mitchellh/gox - -build: dep - @gox -output="${CI_PROJECT_DIR}/${PROJECT_NAME}/{{.Dir}}_{{.OS}}_{{.Arch}}" -parallel=6 - -clean: - @rm -f $(PROJECT_NAME) - -help: - @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'