-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (49 loc) · 1.27 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
name: Rust
on:
push:
branches: [ master ]
paths-ignore:
- "**.md"
pull_request:
branches: [ master ]
paths-ignore:
- "**.md"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
lints:
name: Cargo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Crates and build cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
# We want to update the cache at each run
key: rust-${{ runner.os }}-${{ github.run_id }}
# But we will utilize old ones as well
# (hopefully won't pile up)
restore-keys: rust-${{ runner.os }}-
- name: Check formatting
run: cargo fmt --all --verbose --check
- name: Install protocol buffer compiler
run: sudo apt install -y protobuf-compiler
- run: cargo check
- name: Clippy
run: cargo clippy --features console-log,file-log --fix -- -D warnings
- name: Documentation build
run: cargo doc --no-deps --workspace
tests:
name: Rust tests
runs-on: ubuntu-latest
needs: [lints]
steps:
- uses: actions/checkout@v3
- run: cargo test