diff --git a/.circleci/config.yml b/.circleci/config.yml index 6491beb..537111e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,17 @@ jobs: # a collection of steps # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ path: backend/reports/coverage/lcov-report destination: backend-coverage + - run: + name: copy frontend coverage + command: cp ./frontend/coverage/lcov.info ./backend/reports/coverage/lcov_frontend.info + - run: + name: merge frontend and backend coverage + command: ./backend/node_modules/.bin/lcov-result-merger './backend/reports/coverage/lco*.info' './backend/reports/coverage/lcov_merged.info' + - run: + command: cat ./backend/reports/coverage/lcov_merged.info | ./backend/node_modules/.bin/coveralls + environment: + COVERALLS_SERVICE_NAME: circle-ci + COVERALLS_GIT_BRANCH: ${CIRCLE_BRANCH} - save_cache: paths: - backend/node_modules diff --git a/README.md b/README.md index bb8548e..e1b734c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![CircleCI](https://circleci.com/gh/SAP/code-snippet.svg?style=svg)](https://circleci.com/gh/SAP/code-snippet) +[![Coverage Status](https://coveralls.io/repos/github/SAP/code-snippet/badge.svg?branch=master)](https://coveralls.io/github/SAP/code-snippet?branch=master) ![GitHub license](https://img.shields.io/badge/license-Apache_2.0-blue.svg) [![REUSE status](https://api.reuse.software/badge/github.com/SAP/code-snippet)](https://api.reuse.software/info/github.com/SAP/code-snippet) [![dependentbot](https://api.dependabot.com/badges/status?host=github&repo=SAP/code-snippet)](https://dependabot.com/) diff --git a/backend/package.json b/backend/package.json index ff17282..4265456 100644 --- a/backend/package.json +++ b/backend/package.json @@ -159,6 +159,8 @@ "string-replace-loader": "^2.1.1", "vsce": "^1.73.0", "webpack": "^4.43.0", - "webpack-cli": "^3.3.11" + "webpack-cli": "^3.3.11", + "lcov-result-merger": "3.1.0", + "coveralls": "3.1.0" } } diff --git a/frontend/jest.config.js b/frontend/jest.config.js index ad4aa5a..a4a1355 100644 --- a/frontend/jest.config.js +++ b/frontend/jest.config.js @@ -9,6 +9,7 @@ module.exports = { "!/src/plugins/**" ], coverageReporters: [ + "lcov", "html", "text-summary" ],