featurebase/.circleci/config.yml
2020-02-06 19:46:01 -06:00

228 lines
5.9 KiB
YAML

version: 2
defaults: &defaults
working_directory: /go/src/github.com/pilosa/pilosa
docker:
- image: circleci/golang:1.13
environment:
GO111MODULE: "on"
fast-checkout: &fast-checkout
attach_workspace:
at: .
add-github-auth: &add-github-auth
run: git config --global url."https://moleculacorp:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com".insteadOf "https://github.com"
jobs:
setup:
<<: *defaults
steps:
- *add-github-auth
- checkout
- restore_cache:
keys:
- mod-cache-{{ checksum "go.sum" }}
- run: "go mod download"
- save_cache:
key: mod-cache-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod/
- persist_to_workspace:
root: .
paths: "*"
check-license-headers:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: make check-license-headers
linter:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.20.0
- run: sudo cp bin/golangci-lint /usr/local/bin/
- run: make golangci-lint
test-build-arm:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: make build GOOS=linux GOARCH=arm GOARM=5
- run: make build GOOS=linux GOARCH=arm GOARM=6
- run: make build GOOS=linux GOARCH=arm GOARM=7
- run: make build GOOS=linux GOARCH=arm64
test-golang-1.14-rc:
<<: *defaults
docker:
- image: circleci/golang:1.14-rc
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test
test-golang-1.13: &base-test
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test
test-golang-1.13-shard22:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test SHARD_WIDTH=22
test-golang-1.13-race:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run:
command: make test TESTFLAGS="-race -v -timeout=30m"
no_output_timeout: 30m
test-golang-1.13-386:
<<: *base-test
environment:
GO111MODULE: "on"
GOARCH: 386
test-golang-1.13-enterprise:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test ENTERPRISE=1
test-golang-1.12:
<<: *defaults
docker:
- image: circleci/golang:1.12
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test
test-golang-1.11:
<<: *defaults
docker:
- image: circleci/golang:1.11
steps:
- *fast-checkout
- *add-github-auth
- run: sudo apt-get install lsof
- run: make test
cluster-tests:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- setup_remote_docker
- run: make clustertests-build
prerelease:
<<: *base-test
steps:
- *fast-checkout
- *add-github-auth
- run: make prerelease
- store_artifacts:
path: build
- persist_to_workspace:
root: .
paths: build
release:
<<: *defaults
steps:
- *fast-checkout
- *add-github-auth
- run: make release
- store_artifacts:
path: build
- persist_to_workspace:
root: .
paths: build
prerelease-upload:
docker:
- image: circleci/python:2.7-jessie
steps:
- run: '[[ -v CIRCLE_PR_NUMBER ]] && circleci step halt || true' # Skip job if this is a PR
- *fast-checkout
- *add-github-auth
- run: sudo pip install awscli
- run: make prerelease-upload
dockerhub-upload:
<<: *defaults
steps:
- run: '[[ -v CIRCLE_PR_NUMBER ]] && circleci step halt || true' # Skip job if this is a PR
- *fast-checkout
- *add-github-auth
- setup_remote_docker
- run: make docker
- run: docker tag pilosa:$(git describe --tags) pilosa/pilosa:master
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker push pilosa/pilosa:master
docker-enterprise-upload:
<<: *defaults
steps:
#- run: '[[ -v CIRCLE_PR_NUMBER ]] && circleci step halt || true' # Skip job if this is a PR
- *fast-checkout
- *add-github-auth
- setup_remote_docker
- run: make docker-enterprise
- run: docker tag pilosa:$(git describe --tags) molecula.azurecr.io/pilosa-enterprise:unstable
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker push molecula.azurecr.io/pilosa-enterprise:unstable
workflows:
version: 2
test:
jobs:
- setup
- linter:
requires:
- setup
- check-license-headers:
requires:
- setup
- test-build-arm:
requires:
- setup
- test-golang-1.14-rc:
requires:
- setup
- test-golang-1.13-enterprise:
requires:
- setup
- test-golang-1.13-race:
requires:
- setup
- test-golang-1.13-386:
requires:
- setup
- test-golang-1.13:
requires:
- setup
- test-golang-1.12:
requires:
- setup
- test-golang-1.11:
requires:
- setup
- cluster-tests:
requires:
- setup
- prerelease:
requires:
- linter
- check-license-headers
- test-golang-1.13
- release:
requires:
- linter
- check-license-headers
- test-golang-1.13
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/