2020-06-04 08:54:17 +00:00
|
|
|
version: 2.1
|
2019-05-27 13:51:49 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2020-08-31 05:27:51 +00:00
|
|
|
- image: circleci/golang:1.15
|
2019-12-05 20:20:46 +00:00
|
|
|
resource_class: medium
|
2019-05-27 13:51:49 +00:00
|
|
|
|
|
|
|
working_directory: /go/src/github.com/ledgerwatch/turbo-geth
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: "Setup custom environment variables"
|
|
|
|
command: |
|
|
|
|
echo 'export GO111MODULE="on"' >> $BASH_ENV
|
|
|
|
echo 'export TEST_RESULTS="/tmp/test-results"' >> $BASH_ENV
|
|
|
|
source $BASH_ENV
|
|
|
|
|
|
|
|
- checkout
|
2020-10-07 10:12:10 +00:00
|
|
|
- setup_remote_docker
|
2019-05-27 13:51:49 +00:00
|
|
|
- run: mkdir -p ${TEST_RESULTS}
|
|
|
|
- run: go env
|
2020-06-04 08:54:17 +00:00
|
|
|
- run: git submodule update --init --recursive
|
2019-05-27 13:51:49 +00:00
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-06-04 08:54:17 +00:00
|
|
|
- v1-pkg-cache-{{ arch }}-{{ checksum "go.sum" }}
|
2019-05-27 13:51:49 +00:00
|
|
|
|
2020-06-04 08:54:17 +00:00
|
|
|
- run: go mod tidy && test -z "$(git status --porcelain)"
|
2019-05-27 13:51:49 +00:00
|
|
|
- run: go mod download
|
|
|
|
- run: go mod verify
|
|
|
|
- run: go get github.com/jstemmer/go-junit-report
|
|
|
|
- run: make lintci-deps
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Run extra linters
|
|
|
|
command: make lintci
|
|
|
|
no_output_timeout: 10m
|
|
|
|
|
|
|
|
- run: make
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Run unit tests
|
|
|
|
command: |
|
|
|
|
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
|
|
|
|
make test | tee ${TEST_RESULTS}/go-test.out
|
|
|
|
no_output_timeout: 10m
|
|
|
|
|
|
|
|
- save_cache:
|
2020-06-04 08:54:17 +00:00
|
|
|
key: v1-pkg-cache-{{ arch }}-{{ checksum "go.sum" }}
|
|
|
|
paths: "/go/pkg/mod"
|
|
|
|
|
2019-05-27 13:51:49 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-results
|
|
|
|
destination: raw-test-output
|
|
|
|
|
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-results
|
2020-10-07 10:12:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
- run: docker build .
|