Skip to content

Commit 18c12f0

Browse files
committedFeb 7, 2024
feat: set codecov to informational, remove dead code in nyc config
- remove the parsing of changed files for PRs via nyc.config.js - add codecov.yml and set reports to informational only (dont block PRs) - add codecov badge to README
1 parent b37a0d4 commit 18c12f0

File tree

4 files changed

+9
-45
lines changed

4 files changed

+9
-45
lines changed
 

‎.github/workflows/nodejs.yml

-13
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,11 @@ jobs:
4545
run: |
4646
npm run test-coverage-ci || echo "Silently ignoring coverage threshold limit..."
4747
48-
- name: Check if a valid lcov.info file is generated
49-
id: check-lcov-non-empty
50-
run: |
51-
if [ -s "./coverage/lcov.info" ]; then
52-
echo "lcov.info is not empty."
53-
echo "isNotEmpty=true" >> $GITHUB_OUTPUT
54-
else
55-
echo "lcov.info is empty."
56-
echo "isNotEmpty=false" >> $GITHUB_OUTPUT
57-
fi
58-
5948
- name: Upload test coverage report
60-
if: ${{ steps.check-lcov-non-empty.outputs.isNotEmpty == 'true'}}
6149
uses: codecov/codecov-action@v4.0.1
6250
with:
6351
files: ./coverage/lcov.info
6452
token: ${{ secrets.CODECOV_TOKEN }}
6553
# - name: Exit if coverage condition not met
6654
# if: ${{ steps.test.outputs.exit_code }} != 0
6755
# run: exit ${{ steps.test.outputs.exit_code }}
68-

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
2727
[![NPM](https://img.shields.io/npm/v/@finos/git-proxy?colorA=00C586&colorB=000000)](https://www.npmjs.com/package/@finos/git-proxy)
2828
[![Build](https://img.shields.io/github/actions/workflow/status/finos/git-proxy/nodejs.yml?branch=main&label=CI&logo=github&colorA=00C586&colorB=000000)](https://github.com/finos/git-proxy/actions/workflows/nodejs.yml)
29+
[![codecov](https://codecov.io/gh/finos/git-proxy/branch/main/graph/badge.svg)](https://codecov.io/gh/finos/git-proxy)
2930
[![Documentation](https://img.shields.io/badge/_-documentation-000000?colorA=00C586&logo=docusaurus&logoColor=FFFFFF&)](https://git-proxy.finos.org)
3031
<br />
3132
[![License](https://img.shields.io/github/license/finos/git-proxy?colorA=00C586&colorB=000000)](https://github.com/finos/git-proxy/blob/main/LICENSE)

‎codecov.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true
6+
patch:
7+
default:
8+
informational: true

‎nyc.config.js

-32
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
1-
/* eslint-disable max-len */
2-
'use strict';
3-
4-
// const { execFileSync } = require('child_process');
5-
61
const opts = {
72
branches: 80,
83
lines: 80,
94
functions: 80,
105
statements: 80,
116
};
127

13-
// Only generate coverage report for changed files in PR
14-
// see: https://github.com/actions/checkout/issues/438#issuecomment-1446882066
15-
// https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
16-
// if (process.env.GITHUB_BASE_REF !== undefined) {
17-
// console.log('Generating coverage report for changed files...');
18-
// try {
19-
// const baseRef = execFileSync('git', [
20-
// 'rev-parse',
21-
// `origin/${process.env.GITHUB_BASE_REF}`,
22-
// ])
23-
// .toString()
24-
// .replace('\n', '');
25-
// const headRef = process.env.GITHUB_SHA;
26-
// const stdout = execFileSync('git', [
27-
// 'diff',
28-
// '--name-only',
29-
// `${baseRef}..${headRef}`,
30-
// ]).toString();
31-
// opts = {
32-
// ...opts,
33-
// include: stdout.split('\n'),
34-
// };
35-
// } catch (error) {
36-
// console.log('Error: ', error);
37-
// }
38-
// }
39-
408
console.log('nyc config: ', opts);
419
module.exports = opts;

0 commit comments

Comments
 (0)
Please sign in to comment.