1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
9.3 KiB
YAML

# CircleCI 2.0 configuration file
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
lint:
docker:
- image: cimg/go:1.20.0
steps:
# Don't do a restore_cache here, so we regularly check that the Go
# modules are actually fetchable.
- checkout
- run: go version
- run: test -z "$(gofmt -l . | tee /dev/stderr)"
- run: go vet ./...
resource_class: large
cross_compile:
docker:
- image: cimg/go:1.20.0
steps:
- checkout
- 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"
- run: sudo apt-get update
- run: sudo apt-get install musl-dev musl-tools
- run: sudo apt-get install gcc-arm-linux-gnueabi
- run: sudo apt-get install gcc-aarch64-linux-gnu
- run: sudo apt-get install gcc-powerpc64-linux-gnu
- run: sudo apt-get install gcc-powerpc64le-linux-gnu
- run: sudo apt-get install gcc-riscv64-linux-gnu
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=musl GOOS=linux CC=musl-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=arm GOOS=linux CC=arm-linux-gnueabi-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=arm64 GOOS=linux CC=aarch64-linux-gnu-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=ppc64 GOOS=linux CC=powerpc64-linux-gnu-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=ppc64le GOOS=linux CC=powerpc64le-linux-gnu-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=riscv64 GOOS=linux CC=riscv64-linux-gnu-gcc
cross_compile_mips:
docker:
- image: cimg/go:1.20.0
steps:
- checkout
- 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"
- run: sudo apt-get update
- run: sudo apt-get install gcc-mips-linux-gnu
- run: sudo apt-get install gcc-mipsel-linux-gnu
- run: sudo apt-get install gcc-mips64-linux-gnuabi64
- run: sudo apt-get install gcc-mips64el-linux-gnuabi64
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-X -s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=mips GOOS=linux CC=mips-linux-gnu-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-X -s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=mipsle GOOS=linux CC=mipsel-linux-gnu-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-X -s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=mips64 GOOS=linux CC=mips64-linux-gnuabi64-gcc
- run:
command: go install -a -tags sqlite_omit_load_extension -ldflags="-X -s" ./...
environment:
GORACE: CGO_ENABLED=1 GOARCH=mips64le GOOS=linux CC=mips64el-linux-gnuabi64-gcc
test:
docker:
- image: cimg/go:1.20.0
steps:
- checkout
- 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"
- run: go test -failfast ./...
resource_class: large
race_odd:
docker:
- image: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: go get -t -d ./...
- run:
command: go test -failfast -timeout 20m -race $(go list ./... | sed -n 'n;p')
environment:
GORACE: "halt_on_error=1"
race_even:
docker:
- image: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: go get -t -d ./...
- 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: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests
- run: go version
- run: go get -t -d -v ./...
- 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: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests
- run: go version
- run: go get -t -d -v ./...
- 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: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests
- run: go version
- run: go get -t -d -v ./...
- 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: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests
- run: go version
- run: go get -t -d -v ./...
- 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: cimg/go:1.20.0
- image: consul
- image: gcr.io/etcd-development/etcd:v3.5.1
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests
- run: go version
- run: go get -t -d -v ./...
- 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: cimg/go:1.20.0
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: sudo apt-get update
- run: sudo apt-get install python3
- run: sudo apt install python3-pip
- run: python3 -m pip install requests boto3
- run: go version
- run: go get -t -d -v ./...
- 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_mips
- 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