-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
44 lines (43 loc) · 1.58 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
41
42
43
machine:
environment:
PACKAGE_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
GOPATH: "$HOME/.go_workspace"
PROJECT_DIR: "$GOPATH/src/$PACKAGE_PATH"
GODIST: "go1.6.2.linux-amd64.tar.gz"
centralconfig_service_url: "http://localhost:3000"
post:
# Install the specified version of Go
- mkdir -p download
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
# Go get and install the centralconfig service
- go get -t -d -v github.com/cagedtornado/centralconfig/...
- go install -v github.com/cagedtornado/centralconfig/...
# Start the service and run it in the background
- centralconfig serve:
background: true
dependencies:
pre:
# Sanity check that our go version is installed
- go version
# Unit test reports
- go get -u github.com/jstemmer/go-junit-report
override:
# Go configuration on CircleCI is wonky. Make our code
# is in the correct Go workspace structure
- mkdir -p "$PROJECT_DIR"
- rsync -azC --delete ./ --include=".git" "$PROJECT_DIR"
- rm -rf $CIRCLE_PROJECT_REPONAME
- go get -t -d -v $PACKAGE_PATH/...
cache_directories:
# Cache the Go version source
- ~/download
test:
pre:
- go vet -x $PACKAGE_PATH/...
- mkdir $CIRCLE_TEST_REPORTS/junit
override:
- go test -v -race $PACKAGE_PATH/...
post:
- go test -v -race $PACKAGE_PATH/... | go-junit-report > $CIRCLE_TEST_REPORTS/junit/junit.xml