Skip to content

Commit

Permalink
Build both go-1.14 and go-1.15 in circleci with new custom executors (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
KKelvinLo authored Sep 17, 2020
1 parent d8c4868 commit 9d8562d
Showing 1 changed file with 43 additions and 28 deletions.
71 changes: 43 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
version: 2.1
jobs:
build:
executors:
current-go:
docker:
- image: circleci/golang:1.15
prior-go:
docker:
- image: circleci/golang:1.14

build-template: &build-template
environment:
TEST_RESULTS: /tmp/test-results # path to where test results will be saved

environment:
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
steps:
- checkout
- run: mkdir -p $TEST_RESULTS # create the test results directory

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

- restore_cache: # restores saved cache if no changes are detected since last run
keys:
- go-pkg-mod-{{ checksum "go.sum" }}
- run:
name: "Precommit and Coverage Report"
command: |
make ci
find . -name 'coverage.html' > "${TEST_RESULTS}/coverage.lst"
tar -n -cf - -T "${TEST_RESULTS}/coverage.lst" | tar -C "${TEST_RESULTS}" -xvf -
- run:
name: "Precommit and Coverage Report"
command: |
make ci
find . -name 'coverage.html' > "${TEST_RESULTS}/coverage.lst"
tar -n -cf - -T "${TEST_RESULTS}/coverage.lst" | tar -C "${TEST_RESULTS}" -xvf -
- save_cache:
key: go-pkg-mod-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"

- save_cache:
key: go-pkg-mod-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- store_artifacts:
path: /tmp/test-results
destination: opentelemetry-go-contrib-test-output

- store_artifacts:
path: /tmp/test-results
destination: opentelemetry-go-contrib-test-output
- store_test_results:
path: /tmp/test-results

jobs:
current-go:
executor: current-go
<<: *build-template

prior-go:
executor: prior-go
<<: *build-template

- store_test_results:
path: /tmp/test-results

integration:

parameters:
Expand Down Expand Up @@ -71,10 +84,12 @@ workflows:
version: 2.1
build_and_test:
jobs:
- build
- current-go
- prior-go

integration_test:
jobs:
- integration:
matrix:
parameters:
target: [test-gocql, test-mongo-driver, test-gomemcache]
target: [test-gocql, test-mongo-driver, test-gomemcache]

0 comments on commit 9d8562d

Please sign in to comment.