-
Notifications
You must be signed in to change notification settings - Fork 22
37 lines (33 loc) · 1.08 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
name: Rust
on:
push:
paths:
- "**.rs"
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}
env:
CARGO_TERM_COLOR: always
LLVM_PROFILE_FILE: "rust-ocpp-%p-%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: download grcov for code coverage
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
- name: install llvm tools preview
run: rustup component add llvm-tools-preview
- name: Build
run: cargo build --all-features
- name: Run tests
run: LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --all-features
- name: Generate lcov.info for Code coverage
run: ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Codecov
uses: codecov/[email protected]
with:
files: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}