4545 run : cargo fmt -- --check
4646 - name : Clippy
4747 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
4882 build :
4983 strategy :
5084 fail-fast : false
@@ -159,6 +193,14 @@ jobs:
159193 shell : bash
160194 - name : Test bindings
161195 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
162204 test-linux-binding :
163205 name : Test ${{ matrix.target }} - node@${{ matrix.node }}
164206 needs :
@@ -225,6 +267,26 @@ jobs:
225267 image : ${{ steps.docker.outputs.IMAGE }}
226268 options : ' -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}'
227269 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
228290 publish :
229291 name : Publish
230292 runs-on : ubuntu-latest
@@ -233,6 +295,7 @@ jobs:
233295 id-token : write
234296 needs :
235297 - lint
298+ - test
236299 - test-macOS-windows-binding
237300 - test-linux-binding
238301 steps :
0 commit comments