freifunkmanager/.gitlab-ci.yml

36 lines
959 B
YAML

image: golang:latest
stages:
- build
- test
before_script:
- mkdir -p /go/src/github.com/FreifunkBremen/
- cp -R $CI_PROJECT_DIR /go/src/github.com/FreifunkBremen/
- cd /go/src/github.com/FreifunkBremen/$CI_PROJECT_NAME
build-my-project:
stage: build
script:
- go get -v github.com/FreifunkBremen/$CI_PROJECT_NAME
- mkdir $CI_PROJECT_DIR/bin/
- cp /go/bin/$CI_PROJECT_NAME $CI_PROJECT_DIR/bin/$CI_PROJECT_NAME
artifacts:
paths:
- bin/$CI_PROJECT_NAME
- config_example.conf
test-my-project:
stage: test
script:
- ./.ci/check-gofmt
- ./.ci/check-testfiles
- go get -t -v github.com/FreifunkBremen/$CI_PROJECT_NAME
- go test $(go list ./... | grep -v /vendor/ | grep -v /webroot/) -v -coverprofile .testCoverage.txt
- go tool cover -func=.testCoverage.txt
test-race-my-project:
stage: test
script:
- go get -t -v github.com/FreifunkBremen/$CI_PROJECT_NAME
- go test -race ./...