-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 990 Bytes
/
check-test.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
name: Check and Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- toolchain: "1.77"
features: ""
- toolchain: "nightly-2023-12-26"
features: "--features backtrace"
steps:
- uses: actions/checkout@v3
- name: Override Rust toolchain
run: rustup override set ${{ matrix.toolchain }}
- name: Add Rust components
run: rustup component add rustfmt clippy
- name: Format
run: cargo fmt --check
- name: Build
run: cargo build --all-targets ${{ matrix.features }}
- name: Clippy
run: cargo clippy ${{ matrix.features }} -- -D warnings
- name: Run tests
run: cargo test --workspace ${{ matrix.features }}
- name: Generate docs
run: RUSTDOCFLAGS="-Dwarnings --cfg docsrs" cargo doc --no-deps