-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.45 KB
/
check-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
name: Check Rust
on:
push:
branches: [ main ]
paths:
- .github/workflows/check-rust.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
pull_request:
branches: [ main ]
paths:
- .github/workflows/check-rust.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Rust install
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.68.1
components: clippy, rustfmt
- name: Install Linux requirements
run: |
apt_dependencies="git curl libssl-dev pkg-config libudev-dev"
echo "Run apt update and apt install the following dependencies: $apt_dependencies"
sudo apt update
sudo apt install -y $apt_dependencies
- name: Check rust format
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all
- name: Check clippy for tests
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::derive_partial_eq_without_eq
- name: Run check
run: cargo check
- name: Run tests
run: cargo test --workspace
- name: Run doc
run: export RUSTDOCFLAGS="-Dwarnings" && cargo doc --no-deps