From 2178ad6c2491b637c3e0c3c2109459f7673c0def Mon Sep 17 00:00:00 2001 From: Lambo <12111454+LamboCreeper@users.noreply.github.com> Date: Sun, 5 Jul 2020 14:14:58 +0100 Subject: [PATCH] Create workflow that sends coverage report to Codacy. --- .github/workflows/coverage.yml | 15 +++++++++++++++ .nycrc | 8 ++++++++ package.json | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coverage.yml create mode 100644 .nycrc diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..b9fdb1a0 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,15 @@ +name: coverage +on: + push: + branches: + - master +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Send Coverage Report To Codacy + run: | + npm i + npm run coverage + CODACY_PROJECT_TOKEN=${{ secrets.CODACY_SECRET }} bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/lcov.info \ No newline at end of file diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..735cb036 --- /dev/null +++ b/.nycrc @@ -0,0 +1,8 @@ +{ + "extends": "@istanbuljs/nyc-config-typescript", + "all": true, + "check-coverage": true, + "include": [ + "src/" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index c07a7aa8..a9591d9c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "node -r dotenv/config ./build/app.js", "build": "tsc", - "coverge": "nyc --reporter=lcov --reporter=text-summary npm test", + "coverage": "nyc --reporter=lcov --reporter=text-summary npm test", "test": "ts-mocha test/**/*Test.ts test/**/**/*Test.ts --exit", "lint": "eslint src --ext .js,.ts" },