Skip to content

Commit d4d2f5d

Browse files
Re-add coverage to TS test
1 parent 3fa4f14 commit d4d2f5d

File tree

3 files changed

+1091
-10
lines changed

3 files changed

+1091
-10
lines changed

.github/workflows/CI.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
with:
7979
github-token: ${{ secrets.GITHUB_TOKEN }}
8080
path-to-lcov: lcov.info
81+
parallel: true
82+
flag-name: rust-unit-tests
8183

8284
build:
8385
strategy:
@@ -193,6 +195,15 @@ jobs:
193195
shell: bash
194196
- name: Test bindings
195197
run: yarn test
198+
- name: Upload coverage report
199+
env:
200+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
201+
uses: coverallsapp/[email protected]
202+
with:
203+
github-token: ${{ secrets.GITHUB_TOKEN }}
204+
path-to-lcov: coverage/lcov.info
205+
parallel: true
206+
flag-name: ${{ matrix.settings.target }}-node@${{ matrix.node }}-binding-tests
196207

197208
test-linux-binding:
198209
name: Test ${{ matrix.target }} - node@${{ matrix.node }}
@@ -260,7 +271,27 @@ jobs:
260271
image: ${{ steps.docker.outputs.IMAGE }}
261272
options: '-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}'
262273
run: yarn test
263-
274+
- name: Upload coverage report
275+
env:
276+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
277+
uses: coverallsapp/[email protected]
278+
with:
279+
github-token: ${{ secrets.GITHUB_TOKEN }}
280+
path-to-lcov: coverage/lcov.info
281+
parallel: true
282+
flag-name: ${{ matrix.target }}-node@${{ matrix.node }}-binding-tests
283+
coverage:
284+
name: Report Coverage
285+
runs-on: ubuntu-latest
286+
needs: [test, test-macOS-windows-binding, test-linux-binding]
287+
steps:
288+
- name: Send coverage
289+
env:
290+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
291+
uses: coverallsapp/[email protected]
292+
with:
293+
github-token: ${{ secrets.GITHUB_TOKEN }}
294+
parallel-finished: true
264295
publish:
265296
name: Publish
266297
runs-on: ubuntu-latest

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"format:rs": "cargo fmt",
5151
"lint": "oxlint .",
5252
"prepublishOnly": "napi prepublish -t npm",
53-
"test": "ava",
53+
"test": "nyc --reporter=lcov ava",
5454
"version": "napi version",
5555
"prepare": "husky"
5656
},
@@ -66,6 +66,7 @@
6666
"husky": "^9.1.7",
6767
"lint-staged": "^16.1.2",
6868
"npm-run-all2": "^8.0.4",
69+
"nyc": "^17.1.0",
6970
"oxlint": "^1.8.0",
7071
"prettier": "^3.6.2",
7172
"tinybench": "^5.0.0",

0 commit comments

Comments
 (0)