81 lines
2.3 KiB
YAML
81 lines
2.3 KiB
YAML
version: 2
|
|
jobs:
|
|
jstest:
|
|
docker:
|
|
- image: circleci/golang:1.11-node-browsers
|
|
working_directory: /go/src/github.com/influxdata/platform
|
|
steps:
|
|
- checkout
|
|
- run: make test-js
|
|
|
|
gotest:
|
|
docker:
|
|
- image: circleci/golang:1.11
|
|
environment:
|
|
GOCACHE: /tmp/go-cache
|
|
DEPCACHEDIR: /tmp/dep-cache
|
|
working_directory: /go/src/github.com/influxdata/platform
|
|
steps:
|
|
- checkout
|
|
|
|
# Run dep ensure, using Circle's cache if applicable.
|
|
- restore_cache:
|
|
name: Restoring dep cache
|
|
keys:
|
|
- platform-depcache-{{ checksum "Gopkg.lock" }}
|
|
- platform-depcache-
|
|
- run: make vendor
|
|
- save_cache:
|
|
name: Saving dep cache
|
|
key: platform-depcache-{{ checksum "Gopkg.lock" }}
|
|
paths:
|
|
- /tmp/dep-cache
|
|
|
|
# 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.
|
|
- run: make test-go # This uses the test cache so it may succeed or fail quickly.
|
|
- run: make vet
|
|
- run: make test-go-race # This doesn't use the test cache, and will not complete quickly.
|
|
# TODO add these checks to the Makefile
|
|
# - run: go get -v -t -d ./...
|
|
# - run: go get honnef.co/go/tools/cmd/megacheck
|
|
# - run: megacheck ./...
|
|
- save_cache:
|
|
name: Saving GOCACHE
|
|
key: platform-gocache-{{ .Branch }}-{{ .Revision }}
|
|
paths:
|
|
- /tmp/go-cache
|
|
when: always
|
|
|
|
deploy:
|
|
docker:
|
|
- image: circleci/golang:1.11-node-browsers
|
|
working_directory: /go/src/github.com/influxdata/platform
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- run: |
|
|
docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
|
|
make nightly
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
build-and-deploy:
|
|
jobs:
|
|
- gotest
|
|
- jstest
|
|
- deploy:
|
|
requires:
|
|
- gotest
|
|
- jstest
|
|
filters:
|
|
branches:
|
|
only: master
|
|
|