-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (53 loc) · 1.6 KB
/
rust.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
61
62
63
64
65
66
name: Rust CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: Install Dependencies
run: sudo apt install libdbus-1-dev pkg-config && rustup component add clippy rustfmt
- name: Run Clippy (Linting)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run Tests
run: cargo test --all-targets --all-features --verbose
- name: Build Project
run: cargo build --release
- name: Upload Build Artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: hrv-rs-build
path: target/release/
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run Coverage Analysis
run: cargo tarpaulin --out Xml --all-targets --all-features
env:
RUSTFLAGS: "-C link-dead-code" # Required for accurate coverage analysis
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: tarpaulin-report.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: tarpaulin-report.xml
fail_ci_if_error: true
flags: unittests