Commit 26beab65 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add CI

parent 5fead2d3
Pipeline #42391 passed with stages
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/feudalClient
- ln -s /go/src/git.scc.kit.edu/feudal /go/src/_/builds/feudalClient
- make dep
lint:
stage: lint
script:
make lint
build:
stage: build
script:
- make build
artifacts:
paths:
- feudalClient
PROJECT_NAME := "feudalClient"
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}
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