Add basic .gitlab-ci.yml file

This commit is contained in:
Maurizio Porrato 2021-05-15 10:48:04 +00:00
parent d52389f5f2
commit 737e06cf0e
1 changed files with 29 additions and 0 deletions

29
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,29 @@
image: golang:latest
variables:
REPO_NAME: gitlab.com/mporrato/uBrowserSync
before_script:
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
stages:
- test
- build
format:
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
compile:
stage: build
script:
- mkdir -p $CI_PROJECT_DIR/bin
- go build -o $CI_PROJECT_DIR/bin/ubsserver -v -ldflags="-s -w" -trimpath ./cmd/ubsserver
artifacts:
paths:
- bin/ubsserver