Commit faf9b5ae authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add CI

parent a9d595ab
image: golang:1.12-alpine
cache:
paths:
- /go/src/github.com
- /go/src/golang.org
- /go/src/google.golang.org
- /go/src/gopkg.in
- /go/src/git.scc.kit.edu
stages:
- lint
- build
before_script:
- apk add --no-cache git make
- mkdir -p /go/src/git.scc.kit.edu/feudal /go/src/_/builds
- cp -r $CI_PROJECT_DIR /go/src/git.scc.kit.edu/feudal/feudalSSH
- ln -s /go/src/git.scc.kit.edu/feudal /go/src/_/builds/feudalSSH
- make dep
lint:
stage: lint
script:
make lint
build:
stage: build
script:
- make build
artifacts:
paths:
- feudalSSH
- feudalSSH.sh
PROJECT_NAME := "feudalSSH"
PKG := "git.scc.kit.edu/feudal/$(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: ## Lint the files
@golint -set_exit_status ${PKG_LIST}
test: ## Run unittests
@go test -short ${PKG_LIST}
race: dep ## Run data race detector
@go test -race -short ${PKG_LIST}
coverage: ## Generate global code coverage report
./tools/coverage.sh;
coverhtml: ## Generate global code coverage report in HTML
./tools/coverage.sh html;
dep: ## Get the dependencies
@go get -v -d ./...
@go get -u golang.org/x/lint/golint
build: dep ## Build the binary file
@go build -i -v $(PKG)
clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment