version: 2.1 jobs: build: docker: - image: circleci/golang:1.15 resource_class: medium 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 - setup_remote_docker - run: mkdir -p ${TEST_RESULTS} - run: go env - run: git submodule update --init --recursive - restore_cache: keys: - v1-pkg-cache-{{ arch }}-{{ checksum "go.sum" }} - run: go mod tidy && test -z "$(git status --porcelain)" - 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: key: v1-pkg-cache-{{ arch }}-{{ checksum "go.sum" }} paths: "/go/pkg/mod" - store_artifacts: path: /tmp/test-results destination: raw-test-output - store_test_results: path: /tmp/test-results - run: docker build .