Skip to content

Commit bfe41db

Browse files
Move coverage from smoke test to rust tests
1 parent 2b7e743 commit bfe41db

File tree

4 files changed

+73
-1689
lines changed

4 files changed

+73
-1689
lines changed

.github/workflows/CI.yml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,40 @@ jobs:
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+
4882
build:
4983
strategy:
5084
fail-fast: false
@@ -159,15 +193,6 @@ jobs:
159193
shell: bash
160194
- name: Test bindings
161195
run: yarn test
162-
- name: Upload coverage report
163-
if: ${{ matrix.settings.host == 'macos-latest' && matrix.node == '22' }}
164-
env:
165-
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
166-
uses: coverallsapp/[email protected]
167-
with:
168-
github-token: ${{ secrets.GITHUB_TOKEN }}
169-
path-to-lcov: coverage/lcov.info
170-
parallel: true
171196

172197
test-linux-binding:
173198
name: Test ${{ matrix.target }} - node@${{ matrix.node }}
@@ -235,18 +260,7 @@ jobs:
235260
image: ${{ steps.docker.outputs.IMAGE }}
236261
options: '-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}'
237262
run: yarn test
238-
coverage:
239-
name: Coverage
240-
runs-on: ubuntu-latest
241-
needs: [test-macOS-windows-binding, test-linux-binding]
242-
steps:
243-
- name: Upload coverage report
244-
env:
245-
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
246-
uses: coverallsapp/[email protected]
247-
with:
248-
github-token: ${{ secrets.GITHUB_TOKEN }}
249-
parallel-finished: true
263+
250264
publish:
251265
name: Publish
252266
runs-on: ubuntu-latest
@@ -255,6 +269,7 @@ jobs:
255269
id-token: write
256270
needs:
257271
- lint
272+
- test
258273
- test-macOS-windows-binding
259274
- test-linux-binding
260275
steps:

0 commit comments

Comments
 (0)