Add .gitlab-ci.yml
[goutils.git] / .gitlab-ci.yml
CommitLineData
afff6835
JN
1image: golang:latest
2
3variables:
4 REPO_NAME: gitlab.com/njoseph/goutils
5
6before_script:
7 - mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
8 - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
9 - cd $GOPATH/src/$REPO_NAME
10
11stages:
12 - test
13 - build
14
15format:
16 stage: test
17 script:
18 - go fmt $(go list ./... | grep -v /vendor/)
19 - go vet $(go list ./... | grep -v /vendor/)
20 - go test -race $(go list ./... | grep -v /vendor/)
21
22compile:
23 stage: build
24 script:
25 - go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/goutils
26 artifacts:
27 paths:
28 - goutils