-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (78 loc) · 2.29 KB
/
Copy pathci.yml
File metadata and controls
94 lines (78 loc) · 2.29 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.89.0
components: rustfmt, clippy
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
test-and-coverage:
name: Test and Collect Coverage
runs-on: ubuntu-latest
needs: lint
permissions:
contents: read
env:
RUST_TOOLCHAIN: 1.89.0
CI: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: llvm-tools-preview
- name: Cache using Swatinem/rust-cache
uses: Swatinem/rust-cache@v2
- name: Install Protobuf compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install cargo tools
run: |
cargo install cargo-llvm-cov --locked
cargo install cargo-nextest --version 0.9.114 --locked
- name: Run tests with nextest and generate coverage
run: |
cargo llvm-cov nextest --profile ci --all-features --workspace --lcov --output-path lcov.info --ignore-filename-regex "src/generated/.*|src/errors.rs"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: lcov.info
flags: unittests
name: codecov-umbrella
verbose: true