Skip to content

Commit d9e4cda

Browse files
author
Donovan Dall
committed
Add code coverage reporting
1 parent 2d42412 commit d9e4cda

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test-and-upload-coverage
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
9+
cancel:
10+
name: Cancel Previous Runs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: cancel running workflows
14+
uses: everphone-gmbh/cancel-previous-workflows@v5
15+
env:
16+
GITHUB_TOKEN: ${{ github.token }}
17+
18+
coverage:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
redis-version: [4, 5]
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Cache cargo bin
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.cargo/registry
30+
~/.cargo/git
31+
target
32+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
33+
- uses: actions-rs/toolchain@v1
34+
with:
35+
toolchain: nightly
36+
override: true
37+
- name: Run cargo-tarpaulin
38+
uses: actions-rs/[email protected]
39+
with:
40+
args: '-t 640'
41+
out-type: Lcov
42+
- uses: romeovs/[email protected]
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
lcov-file: ./lcov.info
46+
- name: Archive code coverage results
47+
uses: actions/upload-artifact@v1
48+
with:
49+
name: code-coverage-report
50+
path: lcov.info

0 commit comments

Comments
 (0)