Skip to content

Commit e458809

Browse files
evantorriejmacdlizthegrey
authored
Build both go-1.13 and go-1.14 in circleci (#569)
This PR changes the circleci build config to build the project in both go-1.13 and go-1.14 versions. Co-authored-by: Joshua MacDonald <[email protected]> Co-authored-by: Liz Fong-Jones <[email protected]>
1 parent c97b4f7 commit e458809

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

.circleci/config.yml

+46-26
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
1-
version: 2
2-
jobs:
3-
build:
1+
version: 2.1
2+
executors:
3+
current-go:
44
docker:
5-
- image: circleci/golang:1.14
5+
- image: cimg/go:1.14
6+
prior-go:
7+
docker:
8+
- image: cimg/go:1.13
9+
10+
build-template: &build-template
11+
environment:
12+
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
613

7-
environment:
8-
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
14+
steps:
15+
- checkout
16+
- run: mkdir -p $TEST_RESULTS # create the test results directory
917

10-
steps:
11-
- checkout
12-
- run: mkdir -p $TEST_RESULTS # create the test results directory
18+
- restore_cache: # restores saved cache if no changes are detected since last run
19+
keys:
20+
- cimg-go-pkg-mod-{{ checksum "go.sum" }}
1321

14-
- restore_cache: # restores saved cache if no changes are detected since last run
15-
keys:
16-
- go-pkg-mod-{{ checksum "go.sum" }}
22+
- run:
23+
name: "Precommit and Coverage Report"
24+
command: |
25+
make ci
26+
mv coverage.html $TEST_RESULTS/
1727
18-
- run:
19-
name: "Precommit and Coverage Report"
20-
command: |
21-
make ci
22-
mv coverage.html $TEST_RESULTS/
28+
- save_cache:
29+
key: cimg-go-pkg-mod-{{ checksum "go.sum" }}
30+
paths:
31+
- "/home/circleci/go/pkg/mod"
2332

24-
- save_cache:
25-
key: go-pkg-mod-{{ checksum "go.sum" }}
26-
paths:
27-
- "/go/pkg/mod"
33+
- store_artifacts:
34+
path: /tmp/test-results
35+
destination: opentelemetry-go-test-output
2836

29-
- store_artifacts:
30-
path: /tmp/test-results
31-
destination: opentelemetry-go-test-output
37+
- store_test_results:
38+
path: /tmp/test-results
3239

33-
- store_test_results:
34-
path: /tmp/test-results
40+
jobs:
41+
current-go:
42+
executor: current-go
43+
<<: *build-template
44+
45+
prior-go:
46+
executor: prior-go
47+
<<: *build-template
48+
49+
workflows:
50+
version: 2
51+
build:
52+
jobs:
53+
- current-go
54+
- prior-go

0 commit comments

Comments
 (0)