Skip to content

Commit 2ac7888

Browse files
authored
Merge pull request #499 from theturtle32/add-codecov-integration
Add Codecov integration for coverage reporting
2 parents ae27ddd + 66bbafb commit 2ac7888

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.github/workflows/websocket-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ jobs:
2727
run: pnpm run lint
2828

2929
- name: Run unit tests
30+
if: matrix.node-version != '22.x'
3031
run: pnpm run test
3132

33+
- name: Run unit tests with coverage
34+
if: matrix.node-version == '22.x'
35+
run: pnpm run test:coverage
36+
37+
- name: Upload coverage to Codecov
38+
if: matrix.node-version == '22.x'
39+
uses: codecov/codecov-action@v5
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
3243
- name: Pull Autobahn Test Suite Docker image
3344
run: docker pull crossbario/autobahn-testsuite
3445

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ WebSocket Client & Server Implementation for Node
77

88
[ ![Codeship Status for theturtle32/WebSocket-Node](https://codeship.com/projects/70458270-8ee7-0132-7756-0a0cf4fe8e66/status?branch=master)](https://codeship.com/projects/61106)
99

10+
[![code coverage](https://codecov.io/gh/theturtle32/WebSocket-Node/branch/v2/graph/badge.svg)](https://codecov.io/gh/theturtle32/WebSocket-Node)
11+
1012
Overview
1113
--------
1214
This is a (mostly) pure JavaScript implementation of the WebSocket protocol versions 8 and 13 for Node. There are some example client and server applications that implement various interoperability testing protocols in the "test/scripts" folder.

codecov.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
notify:
4+
wait_for_ci: yes
5+
6+
coverage:
7+
precision: 2
8+
round: down
9+
range: "70...100"
10+
11+
status:
12+
project:
13+
default:
14+
target: 85%
15+
threshold: 1%
16+
if_ci_failed: error
17+
18+
patch:
19+
default:
20+
target: 80%
21+
threshold: 2%
22+
if_ci_failed: error
23+
24+
comment:
25+
layout: "reach,diff,flags,tree"
26+
behavior: default
27+
require_changes: yes
28+
require_base: no
29+
require_head: yes
30+
31+
ignore:
32+
- "test/**"
33+
- "examples/**"
34+
- "bench/**"
35+
- "docs/**"
36+
- "scripts/**"
37+
- "lib/version.js"
38+
- "**/*.test.mjs"
39+
- "**/*.test.js"
40+
- "**/*.bench.mjs"

0 commit comments

Comments
 (0)