influxdb/.circleci/config.yml

128 lines
3.9 KiB
YAML
Raw Normal View History

2018-05-16 15:43:33 +00:00
version: 2
jobs:
jstest:
2018-05-16 15:43:33 +00:00
docker:
2018-08-28 15:38:30 +00:00
- image: circleci/golang:1.11-node-browsers
working_directory: /go/src/github.com/influxdata/platform
steps:
- checkout
2018-12-01 01:02:31 +00:00
# Run npm install, using Circle's cache if applicable.
- restore_cache:
2018-12-01 01:02:31 +00:00
name: Restore npm package cache
keys:
2018-12-01 01:02:31 +00:00
# Only cache on exact package-lock.json match, as in Circle's yarn example:
- chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
- run: make node_modules
- save_cache:
name: Save Yarn package cache
2018-12-01 01:02:31 +00:00
key: chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
paths:
2018-12-01 01:02:31 +00:00
- ~/.cache/npm
- run: make test-js
- run: make chronograf_lint
2018-05-22 20:50:10 +00:00
gotest:
docker:
2018-08-28 15:38:30 +00:00
- image: circleci/golang:1.11
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
2018-05-16 15:43:33 +00:00
working_directory: /go/src/github.com/influxdata/platform
steps:
- checkout
# Populate GOCACHE.
- restore_cache:
name: Restoring GOCACHE
keys:
- platform-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
- platform-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
- platform-gocache- # Matches a new branch.
# Populate GOPATH/pkg.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
2018-12-07 21:50:54 +00:00
- platform-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
- run: make test-go # This uses the test cache so it may succeed or fail quickly.
2018-05-22 22:19:04 +00:00
- run: make vet
- run: make checkfmt
- run: make checktidy
- run: make test-go-race # This doesn't use the test cache because of -count=1, so it will not complete quickly.
2018-05-22 20:50:10 +00:00
# TODO add these checks to the Makefile
# - run: go get -v -t -d ./...
2018-11-01 16:12:38 +00:00
- run: GO111MODULE=on go mod vendor # staticcheck looks in vendor for dependencies.
2018-11-20 19:02:13 +00:00
- run: GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck # Install staticcheck from the version we specify in go.mod.
- run: staticcheck ./...
2018-11-01 16:12:38 +00:00
- save_cache:
name: Saving GOCACHE
key: platform-gocache-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/go-cache
when: always
- save_cache:
name: Saving GOPATH/pkg/mod
2018-12-07 21:50:54 +00:00
key: platform-gomod-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod
when: always
deploy:
docker:
2018-08-28 15:38:30 +00:00
- image: circleci/golang:1.11-node-browsers
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
working_directory: /go/src/github.com/influxdata/platform
steps:
- checkout
# Speed up `make nightly` by restoring caches from previous runs.
- restore_cache:
name: Restoring GOCACHE
keys:
- platform-gocache- # Just match the most recent Go cache.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
2018-12-07 21:50:54 +00:00
- platform-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
- restore_cache:
name: Restore Yarn package cache
keys:
2018-12-01 01:02:31 +00:00
- chronograf-npm-packages-{{ checksum "ui/package-lock.json" }}
- setup_remote_docker
- run: |
docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
make nightly
workflows:
version: 2
build:
jobs:
- gotest
- jstest
2018-12-13 21:48:09 +00:00
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
2018-12-16 09:56:02 +00:00
- gotest
- jstest
2018-12-13 21:48:09 +00:00
- deploy:
requires:
- gotest
- jstest
filters:
branches:
2018-12-16 09:56:02 +00:00
only: master