45
45
run : cargo fmt -- --check
46
46
- name : Clippy
47
47
run : cargo clippy
48
+
49
+ test :
50
+ name : Test
51
+ runs-on : ubuntu-latest
52
+ steps :
53
+ - uses : actions/checkout@v5
54
+ - name : Install Rust toolchain
55
+ uses : dtolnay/rust-toolchain@stable
56
+ with :
57
+ components : llvm-tools-preview
58
+ - name : Install cargo-llvm-cov
59
+ uses : taiki-e/install-action@v2
60
+ with :
61
+ tool : cargo-llvm-cov
62
+ - name : Cache cargo registry
63
+ uses : actions/cache@v4
64
+ with :
65
+ path : |
66
+ ~/.cargo/registry
67
+ ~/.cargo/git
68
+ target
69
+ key : ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
70
+ restore-keys : |
71
+ ${{ runner.os }}-cargo-test-
72
+ - name : Run tests with coverage
73
+ run : cargo llvm-cov --verbose --workspace --lcov --output-path=lcov.info
74
+ - name : Upload coverage to Coveralls
75
+ env :
76
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
77
+ uses :
coverallsapp/[email protected]
78
+ with :
79
+ github-token : ${{ secrets.GITHUB_TOKEN }}
80
+ path-to-lcov : lcov.info
81
+ parallel : true
48
82
build :
49
83
strategy :
50
84
fail-fast : false
@@ -159,6 +193,14 @@ jobs:
159
193
shell : bash
160
194
- name : Test bindings
161
195
run : yarn test
196
+ - name : Upload coverage report
197
+ env :
198
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
199
+ uses :
coverallsapp/[email protected]
200
+ with :
201
+ github-token : ${{ secrets.GITHUB_TOKEN }}
202
+ path-to-lcov : coverage/lcov.info
203
+ parallel : true
162
204
test-linux-binding :
163
205
name : Test ${{ matrix.target }} - node@${{ matrix.node }}
164
206
needs :
@@ -225,6 +267,26 @@ jobs:
225
267
image : ${{ steps.docker.outputs.IMAGE }}
226
268
options : ' -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}'
227
269
run : yarn test
270
+ - name : Upload coverage report
271
+ env :
272
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
273
+ uses :
coverallsapp/[email protected]
274
+ with :
275
+ github-token : ${{ secrets.GITHUB_TOKEN }}
276
+ path-to-lcov : coverage/lcov.info
277
+ parallel : true
278
+ coverage :
279
+ name : Report Coverage
280
+ runs-on : ubuntu-latest
281
+ needs : [test, test-macOS-windows-binding, test-linux-binding]
282
+ steps :
283
+ - name : Send coverage
284
+ env :
285
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
286
+ uses :
coverallsapp/[email protected]
287
+ with :
288
+ github-token : ${{ secrets.GITHUB_TOKEN }}
289
+ parallel-finished : true
228
290
publish :
229
291
name : Publish
230
292
runs-on : ubuntu-latest
@@ -233,6 +295,7 @@ jobs:
233
295
id-token : write
234
296
needs :
235
297
- lint
298
+ - test
236
299
- test-macOS-windows-binding
237
300
- test-linux-binding
238
301
steps :
0 commit comments