From 6dc75abb6d9e33928c9da5dc90272ee1f2137a78 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 22 Jan 2020 15:56:03 +0100 Subject: [PATCH] add codeclimate coverage reporting --- .travis.yml | 8 +++++++- README.md | 3 ++- package.json | 7 +++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6551f5..7e14be0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ matrix: before_install: - npm install -g npm - npm install -g codacy-coverage release-it greenkeeper-lockfile ganache-cli@~6.5.1 + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter before_script: - greenkeeper-lockfile-update @@ -37,9 +39,13 @@ script: - npm run build - npm run doc - npm run integration:cover - - npm run report-coverage after_script: + - npm run report-codacy + - ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.unit.json coverage/unit/lcov.info # Format unit test coverage + - ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.integration.json coverage/integration/lcov.info # Format integration test coverage + - ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 2 # Sum both coverage parts into coverage/codeclimate.json + - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi # Upload coverage/codeclimate.json - greenkeeper-lockfile-upload notifications: diff --git a/README.md b/README.md index a038cd9..3bfcf13 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ [![npm](https://img.shields.io/npm/v/@oceanprotocol/squid.svg)](https://www.npmjs.com/package/@oceanprotocol/squid) [![Travis (.com)](https://img.shields.io/travis/com/oceanprotocol/squid-js.svg)](https://travis-ci.com/oceanprotocol/squid-js) [![GitHub contributors](https://img.shields.io/github/contributors/oceanprotocol/squid-js.svg)](https://github.com/oceanprotocol/squid-js/graphs/contributors) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8508313231b44b0997ec84898cd6f9db)](https://app.codacy.com/app/ocean-protocol/squid-js?utm_source=github.com&utm_medium=referral&utm_content=oceanprotocol/squid-js&utm_campaign=Badge_Grade_Settings) +[![Maintainability](https://api.codeclimate.com/v1/badges/ff173cf1c7adc6b21ae5/maintainability)](https://codeclimate.com/github/oceanprotocol/squid-js/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/ff173cf1c7adc6b21ae5/test_coverage)](https://codeclimate.com/github/oceanprotocol/squid-js/test_coverage) [![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol) [![Greenkeeper badge](https://badges.greenkeeper.io/oceanprotocol/squid-js.svg)](https://greenkeeper.io/) diff --git a/package.json b/package.json index a0cd91f..9c5a024 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,9 @@ "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", "doc": "typedoc --mode modules --out ./doc/ ./src/", "doc:json": "./scripts/typedoc.js", - "merge-coverages": "npx lcov-result-merger \"coverage/*/lcov.info\" coverage/lcov.info", - "report-coverage": "npm run report-coverage:unit && npm run report-coverage:integration", - "report-coverage:unit": "cat coverage/unit/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", - "report-coverage:integration": "cat coverage/integration/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", + "report-codacy": "npm run report-coverage:unit && npm run report-coverage:integration", + "report-codacy:unit": "cat coverage/unit/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", + "report-codacy:integration": "cat coverage/integration/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", "run": "ts-node", "release": "release-it --non-interactive", "changelog": "auto-changelog -p",