Skip to content

Commit 5bdb61c

Browse files
authored
#136 fix: restore WASM coverage job with non-blocking upload (#137)
Restore WASM coverage job that was removed in #135. Set fail_ci_if_error=false to prevent CI failures from empty coverage reports. Add fallback for empty lcov output to ensure valid file exists.
1 parent b7069fe commit 5bdb61c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/reusable-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,49 @@ jobs:
226226
verbose: true
227227
flags: native
228228

229+
wasm-coverage:
230+
name: Coverage (WASM)
231+
runs-on: ubuntu-latest
232+
needs: setup
233+
steps:
234+
- uses: actions/checkout@v5
235+
236+
- name: Install Rust nightly
237+
uses: dtolnay/rust-toolchain@v1
238+
with:
239+
toolchain: nightly
240+
targets: wasm32-unknown-unknown
241+
components: llvm-tools-preview
242+
243+
- name: Cache cargo
244+
uses: Swatinem/rust-cache@v2
245+
with:
246+
shared-key: "nightly-wasm"
247+
save-if: ${{ github.ref == 'refs/heads/main' }}
248+
249+
- name: Install wasmcov
250+
shell: bash
251+
run: |
252+
set -euo pipefail
253+
cargo +nightly install wasmcov
254+
255+
- name: Run WASM tests with coverage
256+
shell: bash
257+
run: |
258+
set -euo pipefail
259+
cargo +nightly wasmcov test -- --all-features -- --test-threads=1
260+
261+
- name: Generate WASM coverage report
262+
shell: bash
263+
run: |
264+
set -euo pipefail
265+
cargo +nightly wasmcov report -- export --format=lcov > wasm-lcov.info || echo "SF:dummy" > wasm-lcov.info
266+
267+
- name: Upload WASM coverage to Codecov
268+
uses: codecov/codecov-action@v5
269+
with:
270+
token: ${{ secrets.CODECOV_TOKEN }}
271+
files: wasm-lcov.info
272+
fail_ci_if_error: false
273+
verbose: true
274+
flags: wasm

0 commit comments

Comments
 (0)