-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (82 loc) · 2.64 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
branches: "**"
pull_request:
branches: "**"
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
RUST_MSRV: "1.70.0" # Default fallback MSRV
jobs:
test:
name: Basic checks
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install cargo-deadlinks
run: cargo install cargo-deadlinks
- name: Build
run: cargo build --verbose
- name: Clippy (default features)
run: cargo clippy --all-targets
- name: Clippy (all features)
run: cargo clippy --all-features --all-targets
- name: Documentation
run: cargo doc --no-deps
- name: Check deadlinks
run: cargo deadlinks
- name: Run tests (default features)
run: cargo test
feature-checks:
name: Feature combination checks
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Check each feature
run: cargo hack check --each-feature --no-dev-deps
- name: Check feature powerset
run: cargo hack check --feature-powerset --no-dev-deps
- name: Clippy each feature
run: cargo hack clippy --each-feature --all-targets
- name: Clippy feature powerset
run: cargo hack clippy --feature-powerset --all-targets
- name: Test each feature
run: cargo hack test --each-feature
- name: Test feature powerset
run: cargo hack test --feature-powerset
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get MSRV from Cargo.toml
run: |
MSRV=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].rust_version // "${{ env.RUST_MSRV }}"')
echo "MSRV=$MSRV" >> $GITHUB_ENV
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: Debug info
run: |
echo "MSRV: $MSRV"
echo "Rust: $(rustc --version)"
- name: Check MSRV
run: cargo check