Skip to content

Commit 613030b

Browse files
authored
Coverage badge reporting (#1)
1 parent ac75533 commit 613030b

File tree

5 files changed

+93
-9
lines changed

5 files changed

+93
-9
lines changed

.github/workflows/node.js.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
4-
name: Node.js CI
1+
name: CI
52

63
on:
74
push:
@@ -16,7 +13,7 @@ jobs:
1613

1714
strategy:
1815
matrix:
19-
node-version: [18.x, 20.x, 22.x]
16+
node-version: [20, 22, 24]
2017
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2118

2219
steps:
@@ -29,3 +26,14 @@ jobs:
2926
- run: npm ci
3027
- run: npm run build --if-present
3128
- run: npm test
29+
- name: Generating ci badge JSONs
30+
if: ${{ matrix.node-version == 20 }}
31+
uses: gaelgirodon/ci-badges-action@v1
32+
with:
33+
gist-id: 334525743d4f008bb0028808bfc44798
34+
token: ${{ secrets.GIST_TOKEN }}
35+
ref: true
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
name: coverage-artifacts-${{ matrix.node-version }}
39+
path: coverage # or path/to/artifact

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
[![Node.js CI](https://github.com/osvalda/smart-time-input/actions/workflows/node.js.yml/badge.svg)](https://github.com/osvalda/smart-time-input/actions/workflows/node.js.yml)
21
[![NPM Version](https://img.shields.io/npm/v/%40osvalda%2Fsmart-time-input)](https://www.npmjs.com/package/@osvalda/smart-time-input)
2+
![GitHub package.json dev/peer/optional dependency version](https://img.shields.io/github/package-json/dependency-version/osvalda/smart-time-input/dev/react)
3+
![GitHub package.json dev/peer/optional dependency version](https://img.shields.io/github/package-json/dependency-version/osvalda/smart-time-input/dev/typescript)
4+
[![Node.js CI](https://github.com/osvalda/smart-time-input/actions/workflows/node.js.yml/badge.svg)](https://github.com/osvalda/smart-time-input/actions/workflows/node.js.yml)
5+
![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fosvalda%2F334525743d4f008bb0028808bfc44798%2Fraw%2Fsmart-time-input-1-merge-junit-tests.json)
6+
![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fosvalda%2F334525743d4f008bb0028808bfc44798%2Fraw%2Fsmart-time-input-lcov-coverage.json)
37

48
## Smart Time Input React Component
59

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
collectCoverageFrom: [
1515
'src/**/*.{ts,tsx}'
1616
],
17+
coverageReporters: ['json-summary', "clover", "json", "lcov", "text"],
1718
verbose: true,
18-
reporters: [['github-actions', {silent: false}], 'summary'],
19+
reporters: [['github-actions', {silent: false}], 'summary', 'jest-junit'],
1920
};

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@types/react": "^19.1.12",
3131
"babel-jest": "^30.1.2",
3232
"jest": "^30.1.3",
33+
"jest-junit": "^16.0.0",
3334
"react": "^19.1.1",
3435
"ts-jest": "^29.4.1",
3536
"ts-node": "^10.9.2",

0 commit comments

Comments
 (0)