-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.35 KB
/
rust-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
54
55
56
57
58
59
60
name: rust-coverage
on:
push:
paths:
- '.github/workflows/rust-coverage.yml'
- 'Cargo.lock'
- 'Cargo.toml'
- 'crates/**'
branches:
- dev
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_MAKE_RUN_CODECOV: true
SQLX_OFFLINE: true
jobs:
checks:
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup the rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo make
run: cargo install [email protected]
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
- name: Toolchain info
run: |
rustc --version
cargo --version --verbose
cargo make --version
- name: Run cargo-tarpaulin
run: cargo make code-coverage
if: github.ref == 'refs/heads/dev'
- name: Upload coverage to Codecov.io
uses: codecov/codecov-action@v3
if: github.ref == 'refs/heads/dev'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: Archive code coverage results
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/dev'
with:
name: code-coverage-report
path: cobertura.xml