-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (44 loc) · 1.37 KB
/
ci.yml
File metadata and controls
57 lines (44 loc) · 1.37 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
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
jobs:
check_formatting:
name: check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
- run: cargo +nightly fmt --all -- --check
check_and_test:
name: check and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: cache Cargo build files
uses: Leafwing-Studios/cargo-cache@ba6ee760ccdefa26b630cff8094e3243ae86a2c9 # v2
- name: prepare build env
run: sudo apt-get install -y lld librdkafka-dev libsasl2-dev
- run: cargo check
- run: cargo clippy -- -Dwarnings --force-warn deprecated --force-warn dead-code
- name: unit tests
run: cargo test