Skip to content

Commit 9d8562d

Browse files
authored
Build both go-1.14 and go-1.15 in circleci with new custom executors (#351)
1 parent d8c4868 commit 9d8562d

File tree

1 file changed

+43
-28
lines changed

1 file changed

+43
-28
lines changed

.circleci/config.yml

+43-28
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,52 @@
11
version: 2.1
2-
jobs:
3-
build:
2+
executors:
3+
current-go:
44
docker:
55
- image: circleci/golang:1.15
6+
prior-go:
7+
docker:
8+
- image: circleci/golang:1.14
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+
- 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+
find . -name 'coverage.html' > "${TEST_RESULTS}/coverage.lst"
27+
tar -n -cf - -T "${TEST_RESULTS}/coverage.lst" | tar -C "${TEST_RESULTS}" -xvf -
1728
18-
- run:
19-
name: "Precommit and Coverage Report"
20-
command: |
21-
make ci
22-
find . -name 'coverage.html' > "${TEST_RESULTS}/coverage.lst"
23-
tar -n -cf - -T "${TEST_RESULTS}/coverage.lst" | tar -C "${TEST_RESULTS}" -xvf -
29+
- save_cache:
30+
key: go-pkg-mod-{{ checksum "go.sum" }}
31+
paths:
32+
- "/go/pkg/mod"
2433

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

30-
- store_artifacts:
31-
path: /tmp/test-results
32-
destination: opentelemetry-go-contrib-test-output
38+
- store_test_results:
39+
path: /tmp/test-results
40+
41+
jobs:
42+
current-go:
43+
executor: current-go
44+
<<: *build-template
45+
46+
prior-go:
47+
executor: prior-go
48+
<<: *build-template
3349

34-
- store_test_results:
35-
path: /tmp/test-results
36-
3750
integration:
3851

3952
parameters:
@@ -71,10 +84,12 @@ workflows:
7184
version: 2.1
7285
build_and_test:
7386
jobs:
74-
- build
87+
- current-go
88+
- prior-go
89+
7590
integration_test:
7691
jobs:
7792
- integration:
7893
matrix:
7994
parameters:
80-
target: [test-gocql, test-mongo-driver, test-gomemcache]
95+
target: [test-gocql, test-mongo-driver, test-gomemcache]

0 commit comments

Comments
 (0)