2020-03-26 01:47:29 +02:00
|
|
|
version: 2.1
|
2020-08-24 18:43:29 +02:00
|
|
|
orbs:
|
|
|
|
codecov: codecov/codecov@1.1.1
|
2020-03-26 01:47:29 +02:00
|
|
|
executors:
|
|
|
|
current-go:
|
2020-07-07 19:35:37 +02:00
|
|
|
resource_class: large
|
2019-07-03 01:21:24 +02:00
|
|
|
docker:
|
2020-08-17 05:04:53 +02:00
|
|
|
- image: cimg/go:1.15
|
2020-03-26 01:47:29 +02:00
|
|
|
prior-go:
|
2020-07-07 19:35:37 +02:00
|
|
|
resource_class: large
|
2020-03-26 01:47:29 +02:00
|
|
|
docker:
|
2020-08-17 05:04:53 +02:00
|
|
|
- image: cimg/go:1.14
|
2020-03-26 01:47:29 +02:00
|
|
|
|
|
|
|
build-template: &build-template
|
|
|
|
environment:
|
|
|
|
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: mkdir -p $TEST_RESULTS # create the test results directory
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
- restore_cache: # restores saved cache if no changes are detected since last run
|
|
|
|
keys:
|
|
|
|
- cimg-go-pkg-mod-{{ checksum "go.sum" }}
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
- run:
|
|
|
|
name: "Precommit and Coverage Report"
|
|
|
|
command: |
|
|
|
|
make ci
|
2020-08-24 18:43:29 +02:00
|
|
|
cp coverage.{out,txt,html} $TEST_RESULTS/
|
|
|
|
|
|
|
|
- codecov/upload:
|
|
|
|
file: "coverage.txt"
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
- save_cache:
|
|
|
|
key: cimg-go-pkg-mod-{{ checksum "go.sum" }}
|
|
|
|
paths:
|
|
|
|
- "/home/circleci/go/pkg/mod"
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-results
|
|
|
|
destination: opentelemetry-go-test-output
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-results
|
2019-07-03 01:21:24 +02:00
|
|
|
|
2020-03-26 01:47:29 +02:00
|
|
|
jobs:
|
|
|
|
current-go:
|
|
|
|
executor: current-go
|
|
|
|
<<: *build-template
|
|
|
|
|
|
|
|
prior-go:
|
|
|
|
executor: prior-go
|
|
|
|
<<: *build-template
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build:
|
|
|
|
jobs:
|
|
|
|
- current-go
|
|
|
|
- prior-go
|