-
-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (54 loc) · 1.46 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
57
58
59
name: CI
on:
pull_request:
push:
permissions:
contents: read
env:
RUST_BACKTRACE: full
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: cargo fmt
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -Dwarnings
- name: cargo doc
run: cargo doc --workspace ${{ matrix.feature_flag }}
env:
RUSTDOCFLAGS: -Dwarnings
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta, '1.64'] # NB. Sync with Cargo.toml.
include:
- os: ubuntu-latest
feature_flag: --features=beta
name: Test ${{ matrix.os }} ${{ matrix.rust }} ${{ matrix.feature_flag }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build ${{ matrix.feature_flag }}
- name: Test
run: cargo test ${{ matrix.feature_flag }}