2019-06-03 15:58:08 +02:00
|
|
|
image: golang:latest
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- mkdir -p /go/src/github.com/FreifunkBremen/
|
2019-06-23 02:52:17 +02:00
|
|
|
- cp -R "$CI_PROJECT_DIR" "/go/src/github.com/FreifunkBremen/"
|
|
|
|
- cd "/go/src/github.com/FreifunkBremen/$CI_PROJECT_NAME"
|
|
|
|
- go get -d -t ./...
|
2019-06-03 15:58:08 +02:00
|
|
|
|
|
|
|
build-my-project:
|
|
|
|
stage: build
|
|
|
|
script:
|
2019-06-23 02:52:17 +02:00
|
|
|
- mkdir "$CI_PROJECT_DIR/bin/"
|
2019-06-05 15:24:57 +02:00
|
|
|
- go get -v github.com/FreifunkBremen/$CI_PROJECT_NAME
|
2019-06-23 02:52:17 +02:00
|
|
|
- mv "/go/bin/$CI_PROJECT_NAME" "$CI_PROJECT_DIR/bin/$CI_PROJECT_NAME"
|
2019-06-03 15:58:08 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-06-23 02:52:17 +02:00
|
|
|
- "bin/$CI_PROJECT_NAME"
|
2019-06-03 15:58:08 +02:00
|
|
|
- config_example.conf
|
|
|
|
|
|
|
|
test-my-project:
|
|
|
|
stage: test
|
|
|
|
script:
|
2019-06-23 02:52:17 +02:00
|
|
|
- go get github.com/client9/misspell/cmd/misspell
|
|
|
|
- misspell -error .
|
2019-06-03 15:58:08 +02:00
|
|
|
- ./.ci/check-gofmt
|
|
|
|
- ./.ci/check-testfiles
|
|
|
|
- go test $(go list ./... | grep -v /vendor/ | grep -v /webroot/) -v -coverprofile .testCoverage.txt
|
|
|
|
- go tool cover -func=.testCoverage.txt
|
2019-06-23 02:52:17 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .testCoverage.txt
|
|
|
|
|
2019-06-03 15:58:08 +02:00
|
|
|
|
|
|
|
test-race-my-project:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- go test -race ./...
|