-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) · 1.29 KB
/
ci.yaml
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
name: ci
on:
push:
branches:
- "main"
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
component: ["api", "agent", "initramfs"]
include:
- component: agent
dependencies: "libudev-dev protobuf-compiler"
- component: api
dependencies: "protobuf-compiler"
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: default
- name: Install clippy
run: rustup component add clippy
- name: Install rustfmt
run: rustup component add rustfmt
- if: ${{ matrix.dependencies }}
name: Install dependencies
run: sudo apt install -y ${{ matrix.dependencies }}
- name: Use cargo cache
uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ matrix.component }}
- name: Build
run: cargo build -p ${{ matrix.component }}
- name: Lint
run: cargo clippy -p ${{ matrix.component }} --no-deps -- -D warnings
- name: Format
run: cargo fmt -p ${{ matrix.component }} -- --check --config format_code_in_doc_comments=true