17
17
matrix :
18
18
rust :
19
19
- version : stable # STABLE
20
- clippy : true
21
20
- version : 1.63.0 # MSRV
22
21
features :
23
22
- default
32
31
- async-https-rustls
33
32
- async-https-rustls-manual-roots
34
33
steps :
35
- - uses : actions/checkout@v4
34
+ - name : Checkout
35
+ uses : actions/checkout@v4
36
36
- name : Generate cache key
37
37
run : echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
38
38
- name : Rust Cache
@@ -43,13 +43,12 @@ jobs:
43
43
~/.cargo/git
44
44
target
45
45
key : ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
46
- - name : Set default toolchain
47
- run : rustup default ${{ matrix.rust.version }}
46
+ - name : Install Rust Toolchain
47
+ uses : dtolnay/rust-toolchain@v1
48
+ with :
49
+ toolchain : ${{ matrix.rust.version }}
48
50
- name : Set profile
49
51
run : rustup set profile minimal
50
- - name : Add clippy
51
- if : ${{ matrix.rust.clippy }}
52
- run : rustup component add clippy
53
52
- name : Update toolchain
54
53
run : rustup update
55
54
- name : Pin dependencies for MSRV
62
61
cargo update -p tokio --precise "1.38.1"
63
62
- name : Build
64
63
run : cargo build --features ${{ matrix.features }} --no-default-features
65
- - name : Clippy
66
- if : ${{ matrix.rust.clippy }}
67
- run : cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
68
64
- name : Test
69
65
run : cargo test --features ${{ matrix.features }} --no-default-features -- --test-threads=1
66
+
67
+ fmt :
68
+ name : Rust Formatting
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - name : Checkout
72
+ uses : actions/checkout@v4
73
+ - name : Install Rust Toolchain
74
+ uses : dtolnay/rust-toolchain@v1
75
+ with :
76
+ toolchain : nightly
77
+ components : rustfmt
78
+ - name : Check fmt
79
+ run : cargo fmt --all --check
80
+
81
+ clippy :
82
+ name : Rust Clippy
83
+ runs-on : ubuntu-latest
84
+ steps :
85
+ - name : Checkout
86
+ uses : actions/checkout@v4
87
+ - name : Install Rust Toolchain
88
+ uses : dtolnay/rust-toolchain@v1
89
+ with :
90
+ toolchain : stable
91
+ components : clippy
92
+ - name : Rust Cache
93
+ uses : actions/cache@v3
94
+ with :
95
+ path : |
96
+ ~/.cargo/registry
97
+ ~/.cargo/git
98
+ target
99
+ key : ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
100
+ - name : Check clippy
101
+ uses : actions-rs/clippy-check@v1
102
+ with :
103
+ token : ${{ secrets.GITHUB_TOKEN }}
104
+ args : --all-features --all-targets -- -D warnings
0 commit comments