-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (92 loc) · 3.2 KB
/
build.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
name: build
on:
pull_request:
push:
branches:
- master
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
cargo-fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly --profile minimal --component rustfmt
- run: cargo +nightly fmt --all -- --check
cargo-clippy:
name: Run linter
runs-on: ubuntu-latest
strategy:
matrix:
rust-toolchain:
- stable
- beta
- nightly
- 1.70.0
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal --component clippy
- run: rustup default ${{ matrix.rust-toolchain }}
- run: cargo clippy --all-targets --no-default-features -- -D warnings
- run: cargo clippy --all-targets -- -D warnings
- run: cargo clippy --all-targets --no-default-features --features "std" -- -D warnings
- run: cargo clippy --all-targets --no-default-features --features "detect-color-support" -- -D warnings
- run: cargo clippy --all-targets --no-default-features --features "custom-default-colors" -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings
cargo-test:
name: Test sources
runs-on: ubuntu-latest
strategy:
matrix:
rust-toolchain:
- stable
- beta
- nightly
- 1.70.0
cargo-flags:
- ""
- "--release"
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal
- run: rustup default ${{ matrix.rust-toolchain }}
- run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features
- run: cargo test --all-targets ${{ matrix.cargo-flags }}
- run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "std"
- run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "detect-color-support"
- run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "custom-default-colors"
- run: cargo test --all-targets ${{ matrix.cargo-flags }} --all-features
cargo-check-no-alloc:
name: Check no-alloc compatibility
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/no-alloc
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: cargo clippy -- -D warnings
- run: cargo build
cargo-check-no-std:
name: Check no-std compatibility
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/no-std
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: cargo clippy -- -D warnings
- run: cargo build
cargo-deny:
name: Check licenses/bans/advisories/sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: cargo install cargo-deny
- run: cargo deny --workspace --all-features check