Skip to content

Commit c63bb85

Browse files
authored
Merge pull request #5 from jtr109/coverage
add coverage with taurpalin
2 parents 325ccb6 + 603f30a commit c63bb85

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/rust.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,37 @@ env:
1111

1212
jobs:
1313
test:
14+
name: Test
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: actions/checkout@v2
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
1719
- name: Run tests
1820
run: cargo test --verbose
21+
22+
coverage:
23+
# template: https://github.com/marketplace/actions/rust-tarpaulin
24+
name: Coverage
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
- name: Install stable toolchain
30+
uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
override: true
34+
- name: Run cargo-tarpaulin
35+
uses: actions-rs/tarpaulin@v0.1
36+
with:
37+
version: '0.9.0'
38+
args: '-- --test-threads 1'
39+
- name: Upload to codecov.io
40+
uses: codecov/codecov-action@v1.0.2
41+
with:
42+
token: ${{secrets.CODECOV_TOKEN}}
43+
- name: Archive code coverage results
44+
uses: actions/upload-artifact@v1
45+
with:
46+
name: code-coverage-report
47+
path: cobertura.xml

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# LeetCode in Rust
22

33
![Unittest](https://github.com/jtr109/leetcode-in-rust/workflows/Unittest/badge.svg)
4+
[![codecov](https://codecov.io/gh/jtr109/leetcode-in-rust/branch/master/graph/badge.svg)](https://codecov.io/gh/jtr109/leetcode-in-rust)
45

56
Resolving problems of LeetCode in RustLang.
67

0 commit comments

Comments
 (0)