Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 6dcedd5

Browse files
committed
Add codecov
1 parent a482b8c commit 6dcedd5

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

.github/workflows/workflow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ jobs:
2424
run: npm install
2525
- name: Tests
2626
run: npm run ci
27+
- name: Codecov test coverage
28+
run: bash scripts/coverage.sh "${{ secrets.CODECOV_TOKEN }}" "${{ matrix.os }}" "${{ matrix.node }}"

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
codecov:
2+
strict_yaml_branch: master
3+
coverage:
4+
range: [80, 100]
5+
parsers:
6+
javascript:
7+
enable_partials: true
8+
comment:
9+
layout: files,flags
10+
require_changes: true

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@
9393
"scripts": {
9494
"prepublishOnly": "run-s build && git push && git push --tags && gh-release",
9595
"ci": "run-s test build",
96-
"test": "run-s test:*",
97-
"test:lint": "eslint --fix \"src/**/*.js\" \"*.js\"",
98-
"test:prettier": "prettier --write --loglevel warn \"src/**/*.js\" \"*.{js,md,yml,json}\"",
99-
"test:ava": "nyc --reporter=lcov ava --verbose",
100-
"test:nyc": "nyc report",
96+
"test": "run-s test:* test:dev:*",
97+
"test-ci": "run-s test:* test:ci:*",
98+
"test:lint": "eslint --ignore-path .gitignore --fix --cache --format=codeframe --max-warnings=0 \"src/**/*.js\" \"*.js\"",
99+
"test:prettier": "prettier --ignore-path .gitignore --write --loglevel warn \"src/**/*.js\" \"*.{js,md,yml,json}\"",
100+
"test:dev:ava": "ava",
101+
"test:ci:ava": "nyc -r lcovonly -r text -r json ava",
101102
"build": "run-s build:*",
102103
"build:webpack": "webpack",
103104
"deptree": "depcruise --exclude '^node_modules' --output-type dot src | dot -T svg > site/dist/dependencygraph.svg",

scripts/coverage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Upload test coverage to Codecov
3+
4+
token="$1"
5+
6+
os="$2"
7+
os="${os/-latest/}"
8+
9+
node="$3"
10+
node="node_${node//./_}"
11+
12+
curl -s https://codecov.io/bash | \
13+
bash -s -- -Z -y codecov.yml -f coverage/coverage-final.json -t "$token" -F "$os" -F "$node"

0 commit comments

Comments
 (0)