1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00
opentelemetry-go/.circleci/config.yml
Bogdan Drutu 9907328c5b
Export coverage report to codecov (#995)
* Export coverage report to codecov

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Use orb and individual coverage files per module

* Run go cover inside module directory to account for local rewrites

Still try to upload using a single file, since orb docs seem to
indicate if you have more than one file, you're going to need to run
the orb multiple times.

* Use correct filename

* Don't do anything silly like appending a file to itself

* Handle subtle differences between FreeBSD and Linux

* Ignore opentelemetry-proto-gen files in exporters/otlp/internal

* Does codecov orb leave current directory in a bad state?

* Copy instead of move

* Ignore generated protobuf code in jaeger exporter module

Co-authored-by: Evan Torrie <evantorrie@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-08-24 09:43:29 -07:00

62 lines
1.3 KiB
YAML

version: 2.1
orbs:
codecov: codecov/codecov@1.1.1
executors:
current-go:
resource_class: large
docker:
- image: cimg/go:1.15
prior-go:
resource_class: large
docker:
- image: cimg/go:1.14
build-template: &build-template
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
- restore_cache: # restores saved cache if no changes are detected since last run
keys:
- cimg-go-pkg-mod-{{ checksum "go.sum" }}
- run:
name: "Precommit and Coverage Report"
command: |
make ci
cp coverage.{out,txt,html} $TEST_RESULTS/
- codecov/upload:
file: "coverage.txt"
- save_cache:
key: cimg-go-pkg-mod-{{ checksum "go.sum" }}
paths:
- "/home/circleci/go/pkg/mod"
- store_artifacts:
path: /tmp/test-results
destination: opentelemetry-go-test-output
- store_test_results:
path: /tmp/test-results
jobs:
current-go:
executor: current-go
<<: *build-template
prior-go:
executor: prior-go
<<: *build-template
workflows:
version: 2
build:
jobs:
- current-go
- prior-go