File tree 1 file changed +9
-21
lines changed
1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -3,23 +3,25 @@ version: 2.1
3
3
references :
4
4
images :
5
5
go : &GOLANG_IMAGE circleci/golang:latest
6
+ environments :
7
+ tmp : &TEST_RESULTS_PATH /tmp/test-results # path to where test results are saved
6
8
7
9
# reusable 'executor' object for jobs
8
10
executors :
9
11
go :
10
12
docker :
11
13
- image : *GOLANG_IMAGE
12
14
environment :
13
- - TEST_RESULTS : /tmp/test-results # path to where test results are saved
15
+ - TEST_RESULTS : *TEST_RESULTS_PATH
14
16
15
17
jobs :
16
- go-fmt-and-vet :
18
+ go-test :
17
19
executor : go
18
20
steps :
19
21
- checkout
22
+ - run : mkdir -p $TEST_RESULTS
20
23
21
- # Restore go module cache if there is one
22
- - restore_cache :
24
+ - restore_cache : # restore cache from dev-build job
23
25
keys :
24
26
- go-version-modcache-v1-{{ checksum "go.mod" }}
25
27
@@ -41,32 +43,18 @@ jobs:
41
43
echo "$files"
42
44
exit 1
43
45
fi
44
- - run : go vet ./...
45
-
46
- go-test :
47
- executor : go
48
- steps :
49
- - checkout
50
- - run : mkdir -p $TEST_RESULTS
51
-
52
- - restore_cache : # restore cache from dev-build job
53
- keys :
54
- - go-version-modcache-v1-{{ checksum "go.mod" }}
55
46
56
47
# run go tests with gotestsum
57
48
- run : |
58
49
PACKAGE_NAMES=$(go list ./...)
59
50
gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES
60
51
- store_test_results :
61
- path : /tmp/test-results
52
+ path : *TEST_RESULTS_PATH
62
53
- store_artifacts :
63
- path : /tmp/test-results
54
+ path : *TEST_RESULTS_PATH
64
55
65
56
workflows :
66
57
version : 2
67
58
test-and-build :
68
59
jobs :
69
- - go-fmt-and-vet
70
- - go-test :
71
- requires :
72
- - go-fmt-and-vet
60
+ - go-test
You can’t perform that action at this time.
0 commit comments