File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 29
29
if : " ${{ matrix.node-version == '14.x' }}"
30
30
- name : Tests
31
31
run : npm run test:ci
32
+ - name : Codecov test coverage
33
+ run : bash bin/report_coverage.sh "${{ matrix.os }}" "${{ matrix.node-version }}"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Upload test coverage to Codecov
3
+ # We need to use a Bash script instead of using a npm script or the official
4
+ # GitHub action because we want to send OS and Node.js version as flags.
5
+ # Codecov does not support dots nor dashes in flags. However, GitHub actions
6
+ # variables for those do, so we need to strip them.
7
+
8
+ os=" $1 "
9
+ os=" ${os/ -latest/ } "
10
+
11
+ node=" $2 "
12
+ node=" node_${node// ./ _} "
13
+
14
+ # We don't use the -Z flag (which makes CI build fail on upload error) and we
15
+ # use the --fail flag (which does not make CI build fail on curl error) because
16
+ # Codecov API fails too often.
17
+ curl --fail -s https://codecov.io/bash | \
18
+ bash -s -- -f coverage/coverage-final.json -F " $os " -F " $node "
Original file line number Diff line number Diff line change
1
+ codecov :
2
+ strict_yaml_branch : master
3
+ coverage :
4
+ range : [80, 100]
5
+ parsers :
6
+ javascript :
7
+ enable_partials : true
8
+ status :
9
+ project : false
10
+ patch : false
11
+ comment : false
Original file line number Diff line number Diff line change 10
10
" bin"
11
11
],
12
12
"bin" : {
13
- "run-e" : " ./bin/run_e.js"
13
+ "run-e" : " ./bin/run_e.js" ,
14
+ "report_coverage" : " ./bin/report_coverage.sh"
14
15
},
15
16
"scripts" : {
16
17
"test" : " run-s format test:dev" ,
You can’t perform that action at this time.
0 commit comments