image: golang:1.10 variables: REPO_NAME: gitlab.servus.at/autoradio/tank before_script: - mkdir -p $GOPATH/src/$(dirname $REPO_NAME) - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME - cd $GOPATH/src/$REPO_NAME - curl -fsSL -o $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 - chmod +x $GOPATH/bin/dep - $GOPATH/bin/dep ensure -vendor-only stages: - test - build format: stage: test script: - go fmt $(go list ./... | grep -v /vendor/) - go vet $(go list ./... | grep -v /vendor/) ## sqlite does not work right now (because the foreign key handling in gorm is flawed) ## so the store test cases need a mysql server now *grrrrr* #- go test -v -cover $(go list ./... | grep -v /vendor/) compile: stage: build script: - go build -ldflags "-extldflags '-static'" -tags netgo -o $CI_PROJECT_DIR/tank ./cmd/tank ## sqlite needs cgo... :( ##- go build -o $CI_PROJECT_DIR/tank ./cmd/tank artifacts: paths: - tank