-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (48 loc) · 1.4 KB
/
ci.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
56
57
58
59
60
61
62
name: Rust CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- version: stable
profile: minimal
- version: beta
profile: default
- version: nightly
profile: default
steps:
- uses: actions/checkout@v4
- name: Setup Rust
run: |
rustup toolchain install ${{ matrix.rust.version }} --profile ${{ matrix.rust.profile }}
rustup default ${{ matrix.rust.version }}
- name: Install protoc
run: sudo apt-get install protobuf-compiler
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ matrix.rust.version }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: cargo fetch
- name: Add clippy component if not stable
if: matrix.rust.version != 'stable'
run: rustup component add clippy
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build project
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Run cargo audit
run: cargo audit