Skip to content

Commit 5e4b88f

Browse files
authored
code: Setup codecov GitHub Action integration
1 parent 9ce97c5 commit 5e4b88f

File tree

4 files changed

+126
-0
lines changed

4 files changed

+126
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,14 @@ jobs:
2222
npm ci
2323
npm run build --if-present
2424
npm test
25+
npm run report
2526
env:
2627
CI: true
28+
- name: Upload coverage to Codecov
29+
uses: codecov/codecov-action@v1
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
file: ./coverage.lcov
33+
flgas: unittests
34+
name: codecov-umbrella
35+
fail_ci_if_error: true

codecov.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
comment:
2+
layout: "diff, files"
3+

package-lock.json

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"scripts": {
1717
"pretest": "eslint --report-unused-disable-directives .",
1818
"test": "nyc mocha --reporter dot tests/** && git diff --exit-code docs/ src/ README.md",
19+
"report": "nyc report --reporter=text-lcov > coverage.lcov",
1920
"testpath": "mocha",
2021
"doc": "rm -f docs/* && mocha --reporter dot tests/** --doc && node tools/build-readme.js",
2122
"build": "npm run doc && node tools/build-all-methods.js"
@@ -27,6 +28,7 @@
2728
"eslint": ">=2.3.0"
2829
},
2930
"devDependencies": {
31+
"codecov": "^3.6.5",
3032
"eslint": "^6.4.0",
3133
"eslint-config-wikimedia": "^0.15.1",
3234
"eslint-plugin-rulesdir": "^0.1.0",

0 commit comments

Comments
 (0)