This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
/
circle.yml
40 lines (38 loc) · 2.11 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
machine:
pre:
- wget https://storage.googleapis.com/golang/go1.11.5.linux-amd64.tar.gz
- tar zxvf go1.11.5.linux-amd64.tar.gz
environment:
GOROOT: ${HOME}/go
GOPATH: ${HOME}/gopath
PATH: ${GOROOT}/bin:${GOPATH}/bin:${PATH}
GO15VENDOREXPERIMENT: 1
post:
- go version
services:
dependencies:
pre:
- mkdir -p ${GOPATH}/src/github.com/mesosphere/mesos-dns
- go version
- go get github.com/mitchellh/gox
- go get github.com/alecthomas/gometalinter
- go get github.com/axw/gocov/gocov # https://github.com/golang/go/issues/6909
- go get github.com/mattn/goveralls
- go get github.com/jstemmer/go-junit-report
- sudo mount --bind $PWD $GOPATH/src/github.com/mesosphere/mesos-dns
- git describe --tags | tee VERSION
- gpg --yes --batch --import build/private.key
override:
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && go install ./...
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && go test -i ./...
- gometalinter --install
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && gox -arch=amd64 -os="linux darwin windows" -output="${CIRCLE_ARTIFACTS}/{{.Dir}}-$(<VERSION)-{{.OS}}-{{.Arch}}" -ldflags="-X main.Version=$(<VERSION)"
- if [ -n "$PASSPHRASE" ]; then for i in ${CIRCLE_ARTIFACTS}/*; do gpg --detach-sig --no-use-agent --yes --batch --passphrase=$PASSPHRASE -u mesos-dns --sign --armor $i; done; fi
test:
override:
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && gometalinter --vendor --concurrency=6 --cyclo-over=12 --tests --exclude='TLS InsecureSkipVerify may be true.' --exclude='Use of unsafe calls should be audited' --deadline=300s ./...
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && gocov test ./... -short -timeout=10m > ~/cov.json
- mkdir -p $CIRCLE_TEST_REPORTS/junit && cd $GOPATH/src/github.com/mesosphere/mesos-dns && go test -v -timeout=10m ./... | go-junit-report > $CIRCLE_TEST_REPORTS/junit/alltests.xml
- cd $GOPATH/src/github.com/mesosphere/mesos-dns && go test -v -short -race -timeout=10m ./...
post:
- goveralls -service=circleci -gocovdata=~/cov.json -repotoken=$COVERALLS_REPO_TOKEN || true