Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

Commit 51b740b

Browse files
committed
README.md: add real documentation
1 parent 4ed7a30 commit 51b740b

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,45 @@
55

66
# ghaction-rust-coverage
77

8-
Docker github action for source-based rust coverage
8+
**ghaction-rust-coverage** is a docker github action that runs rust
9+
tests with source-based coverage enabled. It's essentially a docker
10+
container with nighly rust that runs *cargo test* as described in
11+
[instrument-coverage](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/instrument-coverage.html).
12+
13+
We get a significant speed-up over other github actions due to the use
14+
of the docker container.
15+
16+
Using source-based in rust has shown better coverage data in my
17+
limited tests, specially when the code uses const generics.
18+
19+
20+
## Usage
21+
22+
This is an example of how this action can be used to run the tests and
23+
upload the results to [coveralls](https://coveralls.io/).
24+
25+
```yml
26+
---
27+
name: CI
28+
on: [ push, pull_request ]
29+
jobs:
30+
test-coverage:
31+
name: cargo test with coveralls
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: docker://lpenz/ghaction-rust-coverage:0.2
36+
- uses: coverallsapp/[email protected]
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
path-to-lcov: ./lcov.info
40+
```
41+
42+
43+
## Alternative actions
44+
45+
- [rust-tarpaulin](https://github.com/marketplace/actions/rust-tarpaulin)
46+
- [rust-grcov](https://github.com/marketplace/actions/rust-grcov)
47+
- [grcov-express](https://github.com/marketplace/actions/grcov-express):
48+
mostly equal to *rust-grcov* above, but using a docker container.
949

0 commit comments

Comments
 (0)