neo-go/.circleci/config.yml
Roman Khimov eee457ae49 drop support for Go 1.12
It's old and not maintained. Use latest Go for builds and test only with 1.13
and 1.14.
2020-08-06 16:29:55 +03:00

151 lines
3.5 KiB
YAML

version: 2.1
orbs:
codecov: codecov/codecov@1.0.5
executors:
go1_13:
docker:
- image: circleci/golang:1.13
environment:
GO111MODULE: "on"
go1_14:
docker:
- image: circleci/golang:1.14
environment:
GO111MODULE: "on"
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_14
steps:
- checkout
- gomod
- run:
name: go-lint
command: |
go get -u -v golang.org/x/lint/golint
golint -set_exit_status ./...
vet:
working_directory: /go/src/github.com/nspcc-dev/neo-go
executor: go1_14
steps:
- checkout
- gomod
- run:
name: go-vet
command: go vet ./...
test_1_13:
working_directory: /go/src/github.com/nspcc-dev/neo-go
executor: go1_13
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- gomod
- run: go test -v -race ./...
test_1_14:
working_directory: /go/src/github.com/nspcc-dev/neo-go
executor: go1_14
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- gomod
- run: go test -v -race ./...
test_cover:
working_directory: /go/src/github.com/nspcc-dev/neo-go
executor: go1_14
environment:
CGO_ENABLED: 0
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- gomod
- run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./pkg...,./cli/...
- codecov/upload:
file: coverage.txt
build_cli:
working_directory: /go/src/github.com/nspcc-dev/neo-go
executor: go1_14
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_14
docker:
- image: golang:1-alpine
steps:
- run: apk update && apk add git make curl tar
- checkout
- gomod
- setup_remote_docker
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/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:
- vet:
filters:
tags:
only: v/[0-9]+\.[0-9]+\.[0-9]+/
- lint:
filters:
tags:
only: v/[0-9]+\.[0-9]+\.[0-9]+/
- test_1_13:
filters:
tags:
only: v/[0-9]+\.[0-9]+\.[0-9]+/
- test_1_14:
filters:
tags:
only: v/[0-9]+\.[0-9]+\.[0-9]+/
- test_cover:
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]+/