Add Gitlab CI

This commit is contained in:
2021-11-07 18:50:00 +00:00
parent 7b4558ed9b
commit 1a9a441e29

27
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,27 @@
image: golang:latest
variables:
REPO_NAME: gitlab.com/thatguygriff/aoc2021
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:
- go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/aoc2021
artifacts:
paths:
- aoc2021