6332d3604f
Let's keep the only coverage job, so that CircleCI and GithubAction coverage do not conflict with each other. Also, let's do not require all other tests to pass to report the coverage.
121 lines
2.8 KiB
YAML
121 lines
2.8 KiB
YAML
version: 2.1
|
|
|
|
executors:
|
|
go1_15:
|
|
docker:
|
|
- image: circleci/golang:1.15
|
|
environment:
|
|
GO111MODULE: "on"
|
|
go1_16:
|
|
docker:
|
|
- image: circleci/golang:1.16
|
|
environment:
|
|
GO111MODULE: "on"
|
|
go1_17:
|
|
docker:
|
|
- image: circleci/golang:1.17
|
|
|
|
commands:
|
|
gomod:
|
|
steps:
|
|
- restore_cache:
|
|
keys: [deps-]
|
|
- run:
|
|
name: Download go module dependencies
|
|
command: go mod download
|
|
- save_cache:
|
|
key: deps-{{ checksum "go.sum" }}-{{ checksum "go.sum" }}
|
|
paths: [/go/pkg/mod]
|
|
|
|
jobs:
|
|
lint:
|
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
|
executor: go1_17
|
|
steps:
|
|
- checkout
|
|
- gomod
|
|
- run:
|
|
name: go-lint
|
|
command: |
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1
|
|
make lint
|
|
|
|
test_1_15:
|
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
|
executor: go1_15
|
|
steps:
|
|
- checkout
|
|
- run: git submodule sync
|
|
- run: git submodule update --init
|
|
- gomod
|
|
- run: go test -v -race ./...
|
|
|
|
test_1_16:
|
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
|
executor: go1_16
|
|
steps:
|
|
- checkout
|
|
- run: git submodule sync
|
|
- run: git submodule update --init
|
|
- gomod
|
|
- run: go test -v -race ./...
|
|
|
|
build_cli:
|
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
|
executor: go1_17
|
|
steps:
|
|
- checkout
|
|
- gomod
|
|
- run: make build
|
|
- store_artifacts:
|
|
path: bin
|
|
destination: /
|
|
|
|
build_image:
|
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
|
executor: go1_17
|
|
docker:
|
|
- image: golang:1-alpine
|
|
steps:
|
|
- run: apk update && apk add git make curl tar
|
|
- checkout
|
|
- gomod
|
|
- setup_remote_docker:
|
|
version: 20.10.6
|
|
- run:
|
|
name: Install Docker client
|
|
command: |
|
|
set -x
|
|
VER="20.10.6"
|
|
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
|
|
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
|
|
mv /tmp/docker/* /usr/bin
|
|
- run: make image
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
workflow:
|
|
jobs:
|
|
- lint:
|
|
filters:
|
|
tags:
|
|
only: v/[0-9]+\.[0-9]+\.[0-9]+/
|
|
- test_1_15:
|
|
filters:
|
|
tags:
|
|
only: v/[0-9]+\.[0-9]+\.[0-9]+/
|
|
- test_1_16:
|
|
filters:
|
|
tags:
|
|
only: v/[0-9]+\.[0-9]+\.[0-9]+/
|
|
- build_cli:
|
|
filters:
|
|
tags:
|
|
only: v/[0-9]+\.[0-9]+\.[0-9]+/
|
|
- build_image:
|
|
requires:
|
|
- build_cli
|
|
filters:
|
|
tags:
|
|
only: v/[0-9]+\.[0-9]+\.[0-9]+/
|