|
|
|
# CircleCI 2.0 configuration file
|
|
|
|
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
commands: # a reusable command with parameters
|
|
|
|
restore_and_save_cache:
|
|
|
|
steps:
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- go-mod-v4-{{ checksum "go.sum" }}
|
|
|
|
- run: go get -v -t -d ./...
|
|
|
|
- save_cache:
|
|
|
|
key: go-mod-v4-{{ checksum "go.sum" }}
|
|
|
|
paths:
|
|
|
|
- "/home/circleci/go/pkg/mod"
|
|
|
|
|
|
|
|
cross_compile:
|
|
|
|
parameters:
|
|
|
|
cc:
|
|
|
|
type: string
|
|
|
|
goarch:
|
|
|
|
default: ""
|
|
|
|
type: string
|
|
|
|
goos:
|
|
|
|
default: ""
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: "Cross compile using <<parameters.cc>>"
|
|
|
|
command: go install -a -tags sqlite_omit_load_extension ./...
|
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 1
|
|
|
|
GOARCH: <<parameters.goarch>>
|
|
|
|
GOOS: <<parameters.goos>>
|
|
|
|
CC: <<parameters.cc>>
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
# Don't do a restore_cache here, so we regularly check that the Go
|
|
|
|
# modules are actually fetchable.
|
|
|
|
- checkout
|
|
|
|
- run: test -z "$(gofmt -l . | tee /dev/stderr)"
|
|
|
|
- run: go vet ./...
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
cross_compile:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- cross_compile:
|
|
|
|
cc: x86_64-w64-mingw32-gcc
|
|
|
|
goarch: amd64
|
|
|
|
goos: windows
|
|
|
|
- cross_compile:
|
|
|
|
cc: musl-gcc
|
|
|
|
goarch: amd64
|
|
|
|
- cross_compile:
|
|
|
|
cc: riscv64-linux-gnu-gcc
|
|
|
|
goarch: riscv64
|
|
|
|
- cross_compile:
|
|
|
|
cc: powerpc64le-linux-gnu-gcc
|
|
|
|
goarch: ppc64le
|
|
|
|
cross_compile_arm:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- cross_compile:
|
|
|
|
cc: arm-linux-gnueabi-gcc
|
|
|
|
goarch: arm
|
|
|
|
- cross_compile:
|
|
|
|
cc: aarch64-linux-gnu-gcc
|
|
|
|
goarch: arm64
|
|
|
|
cross_compile_mips:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- cross_compile:
|
|
|
|
cc: mips-linux-gnu-gcc
|
|
|
|
goarch: mips
|
|
|
|
- cross_compile:
|
|
|
|
cc: mips64-linux-gnuabi64-gcc
|
|
|
|
goarch: mips64
|
|
|
|
cross_compile_mips_le:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- cross_compile:
|
|
|
|
cc: mipsel-linux-gnu-gcc
|
|
|
|
goarch: mipsle
|
|
|
|
- cross_compile:
|
|
|
|
cc: mips64el-linux-gnuabi64-gcc
|
|
|
|
goarch: mips64le
|
|
|
|
|
|
|
|
test:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go test -failfast ./...
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
race_odd:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run:
|
|
|
|
command: go test -failfast -timeout 20m -race $(go list ./... | sed -n 'n;p')
|
|
|
|
environment:
|
|
|
|
GORACE: "halt_on_error=1"
|
|
|
|
|
|
|
|
race_even:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run:
|
|
|
|
command: go test -failfast -timeout 20m -race $(go list ./... | sed -n 'p;n')
|
|
|
|
environment:
|
|
|
|
GORACE: "halt_on_error=1"
|
|
|
|
|
|
|
|
end_to_end_single:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/single_node.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
end_to_end_joining:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/joining.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
end_to_end_multi:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/multi_node.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
end_to_end_multi_adv:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/multi_node_adv.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
end_to_end_autoclustering:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
- image: consul
|
|
|
|
- image: gcr.io/etcd-development/etcd:v3.5.1
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/auto_clustering.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
end_to_end_auto_state:
|
|
|
|
docker:
|
|
|
|
- image: rqlite/circleci-primary:0.0.2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_and_save_cache
|
|
|
|
- run: go install -tags osusergo,netgo,sqlite_omit_load_extension
|
|
|
|
-ldflags="-extldflags=-static" ./...
|
|
|
|
- run:
|
|
|
|
command: python3 system_test/e2e/auto_state.py
|
|
|
|
environment:
|
|
|
|
RQLITED_PATH: /home/circleci/go/bin/rqlited
|
|
|
|
resource_class: large
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build_and_test:
|
|
|
|
jobs:
|
|
|
|
- lint
|
|
|
|
- cross_compile
|
|
|
|
- cross_compile_arm
|
|
|
|
- cross_compile_mips
|
|
|
|
- cross_compile_mips_le
|
|
|
|
- test
|
|
|
|
- race_even
|
|
|
|
- race_odd
|
|
|
|
- end_to_end_single
|
|
|
|
- end_to_end_multi
|
|
|
|
- end_to_end_multi_adv
|
|
|
|
- end_to_end_joining
|
|
|
|
- end_to_end_autoclustering
|
|
|
|
- end_to_end_auto_state
|