...
1version: 2
2
3jobs:
4 build:
5 docker:
6 -
7 image: circleci/golang:1.12
8 environment:
9 GOFLAGS: -mod=readonly
10
11 steps:
12 - checkout
13
14 -
15 restore_cache:
16 name: Restore build dependencies
17 keys:
18 - build-deps-v1-{{ .Branch }}-{{ checksum "Makefile" }}
19
20 -
21 restore_cache:
22 name: Restore dependencies
23 keys:
24 - gomod-v1-{{ .Branch }}-{{ checksum "go.sum" }}
25 - gomod-v1-{{ .Branch }}
26 - gomod-v1-master
27 - gomod-v1
28
29 -
30 run:
31 name: Download Go module cache
32 command: go mod download
33
34 -
35 save_cache:
36 name: Save dependencies
37 key: gomod-v1-{{ .Branch }}-{{ checksum "go.sum" }}
38 paths:
39 - /go/pkg/mod
40
41 -
42 run:
43 name: Run tests
44 command: TEST_PKGS=$(echo `go list ./... | circleci tests split`) TEST_REPORT_NAME=results_${CIRCLE_NODE_INDEX}.xml make test
45
46 -
47 save_cache:
48 name: Save build dependencies
49 key: build-deps-v1-{{ .Branch }}-{{ checksum "Makefile" }}
50 paths:
51 - bin/
52
53 -
54 store_test_results:
55 path: build/test_results/
View as plain text