-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged pull request #20 from influxdata/nc-ci
Add CircleCI config
- Loading branch information
Showing
4 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
version: 2 | ||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/golang:1.11 | ||
environment: | ||
GOCACHE: /tmp/go-cache | ||
GOPATH: /tmp/go | ||
GO111MODULE: 'on' # must be quoted to force string type instead of boolean type | ||
steps: | ||
- checkout | ||
# Populate GOCACHE. | ||
- restore_cache: | ||
name: Restoring GOCACHE | ||
keys: | ||
- flux-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run. | ||
- flux-gocache-{{ .Branch }}- # Matches a new commit on an existing branch. | ||
- flux-gocache- # Matches a new branch. | ||
# Populate GOPATH/pkg. | ||
- restore_cache: | ||
name: Restoring GOPATH/pkg/mod | ||
keys: | ||
- flux-gomod-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run. | ||
- flux-gomod-{{ .Branch }}- # Matches a new commit on an existing branch. | ||
- flux-gomod- # Matches a new branch. | ||
# Run tests | ||
- run: make vet | ||
- run: make test | ||
- save_cache: | ||
name: Saving GOCACHE | ||
key: flux-gocache-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- /tmp/go-cache | ||
when: always | ||
- save_cache: | ||
name: Saving GOPATH/pkg/mod | ||
key: flux-gomod-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- /tmp/go/pkg/mod | ||
when: always | ||
test-race: | ||
docker: | ||
- image: circleci/golang:1.11 | ||
environment: | ||
GOPATH: /tmp/go | ||
GO111MODULE: 'on' # must be quoted to force string type instead of boolean type | ||
steps: | ||
- checkout | ||
# Building go with -race does not use the cache | ||
# Populate GOPATH/pkg. | ||
- restore_cache: | ||
name: Restoring GOPATH/pkg/mod | ||
keys: | ||
- flux-gomod-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run. | ||
- flux-gomod-{{ .Branch }}- # Matches a new commit on an existing branch. | ||
- flux-gomod- # Matches a new branch. | ||
# Run tests | ||
- run: make test-race | ||
# No need to save the pkg/mod cache since the other job does it | ||
|
||
workflows: | ||
version: 2 | ||
build-and-test: | ||
jobs: | ||
- test | ||
- test-race |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.