-
Notifications
You must be signed in to change notification settings - Fork 158
92 lines (90 loc) · 2.69 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check Formatting
run: cargo fmt --all -- --check
feature-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust Stable
run: rustup default stable
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Check Feature Matrix
run: cargo hack check --all --all-targets --feature-powerset --release
test:
name: Test (rust-toolchain.toml)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust Stable
run: rustup default stable
- name: Run Tests
run: cargo test --all-features --workspace
test-matrixed:
name: Test ${{ matrix.rust_version }}
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: ['stable', 'nightly']
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust ${{ matrix.rust_version }}
run: rustup install ${{ matrix.rust_version }}
- name: Run Tests
run: cargo +${{ matrix.rust_version }} test --all-features --workspace
docs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust Nightly
run: rustup install nightly
- name: Check Docs
run: cargo +nightly doc --all-features --workspace --no-deps
bench:
name: Bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust Stable
run: rustup default stable
- name: Run Benchmarks
run: cargo bench --all-features --workspace --exclude=metrics-observer --exclude=metrics-benchmark
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protobuf Compiler
run: sudo apt-get install protobuf-compiler
- name: Install Rust Stable
run: rustup default stable
- name: Install Clippy
run: rustup component add clippy
- name: Run Clippy
run: cargo clippy --all-features --workspace --exclude=metrics-benchmark