-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (66 loc) · 2.13 KB
/
rust.yml
File metadata and controls
87 lines (66 loc) · 2.13 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
name: Rust CI
on:
push:
branches: ['**']
pull_request:
branches: ['**']
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt
override: true
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
- name: Check Code Formatting
run: cargo fmt --all -- --check
- name: Install protoc for gRPC server
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Run Clippy (Linter)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build Project
run: cargo build --verbose
- name: Run Tests
run: cargo test --verbose
udeps:
name: Unused Dependencies (cargo-udeps)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Rust (nightly for udeps)
uses: dtolnay/rust-toolchain@nightly
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
- name: Install protoc for gRPC server
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install cargo-udeps
run: cargo +nightly install cargo-udeps --locked
- name: Run cargo-udeps
run: cargo +nightly udeps --workspace --all-targets --all-features
taplo:
name: Taplo (TOML formatting)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Rust (stable for cargo install)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
- name: Install taplo
run: cargo +stable install taplo-cli --version ^0.9 --locked --force
- name: Check TOML formatting with taplo
run: taplo format --check