From 8d8d36de11b2039620a92a1f5db0613362fc5fd9 Mon Sep 17 00:00:00 2001 From: Gabriel Garrido Calvo <2728080+ggarri@users.noreply.github.com> Date: Sat, 8 Jan 2022 11:37:13 +0100 Subject: [PATCH] codecov integration (#220) * codecov integration * use master branch --- .circleci/config.yml | 8 ++++++++ README.md | 3 ++- codecov.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b352b99..db9e5b58 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,9 @@ --- version: 2.1 +orbs: + codecov: codecov/codecov@3.2.2 + executors: node_executor: docker: @@ -101,6 +104,11 @@ jobs: - run: name: Unit tests command: npm run test:coverage + - codecov/upload: + file: coverage/coverage-final.json + - store_artifacts: + path: ./coverage/coverage-final.json + destination: coverage.json publishSdk: executor: node_executor diff --git a/README.md b/README.md index 386fc29b..c7c56143 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ [![npm](https://img.shields.io/npm/v/pegasys-orchestrate)](https://www.npmjs.com/package/pegasys-orchestrate) [![npm](https://img.shields.io/npm/dw/pegasys-orchestrate)](https://www.npmjs.com/package/pegasys-orchestrate) -[![CircleCI](https://img.shields.io/circleci/build/gh/PegaSysEng/orchestrate-node?token=b950a12c7c5f1ba8ae60273360c99d832301057a)](https://circleci.com/gh/PegaSysEng/orchestrate-node) +[![CircleCI](https://img.shields.io/circleci/build/gh/ConsenSys/orchestrate-node?token=b950a12c7c5f1ba8ae60273360c99d832301057a)](https://circleci.com/gh/ConsenSys/orchestrate-node) +[![codecov](https://codecov.io/gh/ConsenSys/orchestrate-node/branch/master/graph/badge.svg)](https://codecov.io/gh/ConsenSys/orchestrate-node) [![Known Vulnerabilities](https://snyk.io/test/github/PegaSysEng/orchestrate-node/badge.svg?targetFile=package.json)](https://snyk.io/test/github/PegaSysEng/orchestrate-node?targetFile=package.json) # Orchestrate Node.js Library diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..4b1830eb --- /dev/null +++ b/codecov.yml @@ -0,0 +1,49 @@ +codecov: + require_ci_to_pass: false + +coverage: + range: 60..100 + round: down + precision: 2 + status: + project: + default: + target: 80% + # Allow decreasing 2% of total coverage to avoid noise. + threshold: 2% + if_ci_failed: error + informational: true + paths: + - "src" + - "!proto/*" + - "!examples/*" + - "!lib/*" + patch: + default: + target: 90% + threshold: 1% + informational: true + paths: + - "src" + - "!proto/*" + - "!examples/*" + - "!lib/*" + +# https://docs.codecov.io/docs/codecovyml-reference#section-parsers +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: no + +ignore: + - proto/* + - lib/* + - examples/*