mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-11 05:17:54 +00:00
- Fix incorrect usage of workspaces (vendor dir in current directory no longer primary cache of go modules) - Refactor checkout, github-auth, and mod cache into a reusable command - Fix issue with dockerhub upload and github authentication
225 lines
5.5 KiB
YAML
225 lines
5.5 KiB
YAML
version: 2.1
|
|
|
|
executors:
|
|
golang:
|
|
parameters:
|
|
version:
|
|
type: string
|
|
default: "1.14"
|
|
resource_class:
|
|
type: string
|
|
default: medium
|
|
docker:
|
|
- image: circleci/golang:<< parameters.version >>
|
|
resource_class: << parameters.resource_class >>
|
|
working_directory: /go/src/github.com/pilosa/pilosa
|
|
environment:
|
|
GO111MODULE: "on" # TODO: Only needed for Go <1.13, remove when dropping support for 1.11/1.12.
|
|
|
|
commands:
|
|
add-github-auth:
|
|
steps:
|
|
- run: git config --global url."https://moleculacorp:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com".insteadOf "https://github.com"
|
|
restore-mod-cache:
|
|
steps:
|
|
- restore_cache:
|
|
key: mod-cache-{{ checksum "go.sum" }}
|
|
save-mod-cache:
|
|
steps:
|
|
- save_cache:
|
|
key: mod-cache-{{ checksum "go.sum" }}
|
|
paths:
|
|
- /go/pkg/mod/
|
|
checkout-plus:
|
|
steps:
|
|
- add-github-auth
|
|
- checkout
|
|
- restore-mod-cache
|
|
|
|
jobs:
|
|
setup:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- run: go mod download
|
|
- save-mod-cache
|
|
check-license-headers:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- run: make check-license-headers
|
|
linter:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.23.8
|
|
- run: make golangci-lint
|
|
test-build-arm:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- 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:
|
|
parameters:
|
|
resource_class:
|
|
type: string
|
|
default: medium
|
|
golang_version:
|
|
type: string
|
|
default: "1.14"
|
|
shard_width:
|
|
type: string
|
|
default: "20"
|
|
test_make_target:
|
|
type: string
|
|
default: "test"
|
|
test_flags:
|
|
type: string
|
|
default: ""
|
|
goarch:
|
|
type: string
|
|
default: amd64
|
|
executor:
|
|
name: golang
|
|
version: << parameters.golang_version >>
|
|
resource_class: << parameters.resource_class >>
|
|
steps:
|
|
- checkout-plus
|
|
- run: sudo apt-get install lsof
|
|
- run:
|
|
command: make << parameters.test_make_target >> SHARD_WIDTH=<< parameters.shard_width >> GOARCH=<< parameters.goarch >>
|
|
no_output_timeout: 30m
|
|
cluster-tests:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- setup_remote_docker
|
|
- run: make clustertests-build
|
|
prerelease:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- run: make prerelease
|
|
- store_artifacts:
|
|
path: build
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths: build
|
|
release:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- attach_workspace:
|
|
at: .
|
|
- run: make release
|
|
- store_artifacts:
|
|
path: build
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths: build
|
|
prerelease-upload:
|
|
docker:
|
|
- image: circleci/python:2.7-jessie
|
|
steps:
|
|
- checkout-plus
|
|
- attach_workspace:
|
|
at: .
|
|
- run: sudo pip install awscli
|
|
- run: make prerelease-upload
|
|
dockerhub-upload-unstable:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- setup_remote_docker
|
|
- run: make docker
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
- run: make docker-tag-push DOCKER_TARGET=moleculacorp/pilosa:<< pipeline.git.branch >>
|
|
dockerhub-upload-stable:
|
|
executor:
|
|
name: golang
|
|
steps:
|
|
- checkout-plus
|
|
- setup_remote_docker
|
|
- run: make docker
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
- run: make docker-tag-push DOCKER_TARGET=moleculacorp/pilosa:<< pipeline.git.tag >>
|
|
- run: make docker-tag-push DOCKER_TARGET=moleculacorp/pilosa:latest
|
|
|
|
workflows:
|
|
build:
|
|
jobs:
|
|
- setup:
|
|
context: molecula
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
- linter:
|
|
requires:
|
|
- setup
|
|
- check-license-headers:
|
|
requires:
|
|
- setup
|
|
- test-build-arm:
|
|
requires:
|
|
- setup
|
|
- test:
|
|
name: test-golang-<< matrix.golang_version >>
|
|
matrix:
|
|
parameters:
|
|
golang_version: ["1.14", "1.13", "1.12", "1.11"]
|
|
requires:
|
|
- setup
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
- test:
|
|
name: test-race
|
|
test_make_target: test-race
|
|
resource_class: xlarge
|
|
requires:
|
|
- setup
|
|
- test:
|
|
name: test-386
|
|
goarch: "386"
|
|
requires:
|
|
- setup
|
|
- test:
|
|
name: test-shardwidth-22
|
|
shard_width: "22"
|
|
requires:
|
|
- setup
|
|
- cluster-tests:
|
|
requires:
|
|
- setup
|
|
- prerelease:
|
|
requires:
|
|
- linter
|
|
- check-license-headers
|
|
- test-golang-1.14
|
|
- dockerhub-upload-unstable:
|
|
context: molecula
|
|
requires:
|
|
- setup
|
|
filters:
|
|
branches:
|
|
only: master
|
|
- dockerhub-upload-stable:
|
|
context: molecula
|
|
requires:
|
|
- setup
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
branches:
|
|
ignore: /.*/
|