From bcdfd223f2cf84ed4c965bec12035599d3a9858f Mon Sep 17 00:00:00 2001 From: Walther Date: Thu, 27 Jul 2023 11:24:19 +0300 Subject: [PATCH] chore: add code coverage for core --- .github/workflows/codecov.yml | 23 +++++++++++++++++++++++ core/package.json | 5 +++-- package.json | 3 ++- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000000..822d2ece3f --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,23 @@ +name: core test coverage + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + name: core test coverage + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.15 + uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 + with: + node-version: 18.15 + - name: Build package + run: | + yarn + yarn build + - name: Run tests and collect coverage + working-directory: ./core + run: yarn coverage + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v3 diff --git a/core/package.json b/core/package.json index 3517be3001..548e7c80d2 100644 --- a/core/package.json +++ b/core/package.json @@ -267,7 +267,8 @@ "integ-minikube": "GARDEN_INTEG_TEST_MODE=local GARDEN_SKIP_TESTS=\"remote-only\" yarn _integ", "integ-remote": "GARDEN_INTEG_TEST_MODE=remote GARDEN_SKIP_TESTS=local-only yarn _integ", "test": "mocha", - "test:silly": "GARDEN_LOGGER_TYPE=basic GARDEN_LOG_LEVEL=silly mocha" + "test:silly": "GARDEN_LOGGER_TYPE=basic GARDEN_LOG_LEVEL=silly mocha", + "coverage": "nyc --reporter lcov mocha" }, "pkg": { "scripts": [ @@ -276,4 +277,4 @@ ] }, "gitHead": "b0647221a4d2ff06952bae58000b104215aed922" -} \ No newline at end of file +} diff --git a/package.json b/package.json index 48040e62a0..31e53f92a7 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "minimist": "^1.2.6", "node-jsonl": "^0.1.0", "npm-license-crawler": "^0.2.1", + "nyc": "^15.1.0", "prettier": "3.0.0", "replace-in-file": "^6.0.0", "semver": "^7.5.4", @@ -100,4 +101,4 @@ "plugins/*", "sdk" ] -} \ No newline at end of file +}