-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (45 loc) · 1.3 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Bindings coverage
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
on:
pull_request:
push:
branches:
- main
jobs:
coverage:
name: Upload coverage
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Verify .rs files 👀
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
- name: Setup Rust ⚙
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
toolchain: 1.71.1
override: true
- name: Prepare rust cache 🗄️
if: env.GIT_DIFF
uses: Swatinem/rust-cache@v2
- name: Install cargo-tarpaulin ⚙
if: env.GIT_DIFF
run: cargo install cargo-tarpaulin
- name: Generate coverage report 🧪
if: env.GIT_DIFF
working-directory: ./packages/bindings
run: cargo tarpaulin --avoid-cfg-tarpaulin --all-features --out xml
env:
RUST_BACKTRACE: 1
- name: Upload coverage 📤
if: env.GIT_DIFF
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/bindings/cobertura.xml