Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 6d39b75

Browse files
mydiemhotbarlow12
authored andcommitted
ci: update pipeline to use codecov (#271)
also fix scripts permission issue
1 parent a8be3d0 commit 6d39b75

File tree

8 files changed

+30
-37
lines changed

8 files changed

+30
-37
lines changed

.codecov.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Validate changes
2+
# cat .codecov.yml | curl --data-binary @- https://codecov.io/validate
3+
4+
comment: on # enable pull request comment
5+
coverage:
6+
range: 70..100
7+
round: down # round down to the precision point
8+
precision: 2
9+
status:
10+
project: # compare project coverage against the base of pr
11+
default:
12+
target: 75% # min coverage ratio to be considered a success
13+
threshold: null # allow coverage to drop by X%
14+
base: auto
15+
patch: # provides an indication on how well the pull request is tested
16+
default:
17+
target: 70% # min coverage ratio to be considered a success

package-lock.json

-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"axios-mock-adapter": "^1.16.0",
7676
"babel-jest": "^24.8.0",
7777
"babel-preset-react-app": "^9.0.0",
78-
"coveralls": "https://github.com/nickmerwin/node-coveralls.git#f0ddec529c8271ea193bfab41de12b6c06d533f5",
7978
"eslint": "^5.16.0",
8079
"jest": "^24.8.0",
8180
"jest-cli": "^24.8.0",

pipelines/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pr:
77
- dev
88

99
variables:
10-
- group: coveralls-credentials # variable group
10+
- group: code-coverage-credentials # variable group
1111

1212
jobs:
1313
- template: templates/unit-tests.yml # path relative to this file

pipelines/templates/unit-tests.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ jobs:
2626
2727
- ${{ if eq(parameters.nodeVersion, '8') }}:
2828
- bash: |
29-
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
29+
set -e
30+
31+
token=$(CODECOV_TOKEN)
32+
if [[ -z "${token}" ]]; then
33+
echo "Need to set CODECOV_TOKEN"
34+
exit 1
35+
fi
36+
37+
# https://docs.codecov.io/docs/about-the-codecov-bash-uploader
38+
bash <(curl -s https://codecov.io/bash) -t ${token}
3039
displayName: 'Upload code coverage report'
3140
env:
32-
COVERALLS_SERVICE_NAME: "Azure DevOps"
33-
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
41+
CODECOV_TOKEN: $(CODECOV_TOKEN)
3442
condition: eq(variables['imageName'], 'ubuntu-16.04')

scripts/build.sh

100644100755
File mode changed.

scripts/publish.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
./$(pwd)/scripts/build.sh
4+
$(pwd)/scripts/build.sh
55

66
# NOTE: auth is taken care of via NPM_TOKEN env variable
77
if [ -z "$1" ]; then

scripts/version.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)