forked from moby/swarmkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
60 lines (49 loc) · 1.97 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
machine:
environment:
OS: "linux"
ARCH: "amd64"
PROTOC: "https://github.com/google/protobuf/releases/download/v3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_64.zip"
GOVERSION: "1.6.2"
GOPATH: "$HOME/.go_workspace"
WORKDIR: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
# Disable default dependency management.
# This prevents go dependencies to be automatically installed in order to
# ensure we are exclusively relying on vendored deps.
#
# https://discuss.circleci.com/t/overriding-go-inference-in-the-dependencies-phase/660
# https://robots.thoughtbot.com/configure-circleci-for-go
dependencies:
pre:
# Wipe out the default go install.
- sudo rm -rf /usr/local/go
# Force the wipe out of GOPATH to make sure we're not relying on
# external dependencies.
- rm -rf "$GOPATH"
override:
# Install Go
- wget "https://storage.googleapis.com/golang/go$GOVERSION.$OS-$ARCH.tar.gz"
- sudo tar -C /usr/local -xzf "go$GOVERSION.$OS-$ARCH.tar.gz"
# Install protoc
- wget "$PROTOC"
- unzip -o "$(basename $PROTOC)" -d "$HOME/bin"
# Setup the GOPATH
- mkdir -p "$(dirname $WORKDIR)"
- cp -R "$HOME/$CIRCLE_PROJECT_REPONAME" "$WORKDIR"
# Install dependencies
- cd "$WORKDIR" && make setup
post:
# Display debugging information in CI logs
- go version
- env
test:
override:
# Run all tests in a single pass to ensure we don't move to the next
# step in case of failure.
# - `all`: Format, build and tests.
# - `checkprotos`: Build and check the proto files *only* once all
# tests pass with checked-in generated code.
# - `coverage`: Generate coverage reports.
- cd "$WORKDIR" && make ci
post:
# Report to codecov.io
- cd "$WORKDIR" && bash <(curl -s https://codecov.io/bash)