Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build both go-1.14 and go-1.15 in circleci with new custom executors #351

Merged
merged 2 commits into from
Sep 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]