@@ -13,26 +13,42 @@ jobs:
13
13
build-test :
14
14
15
15
runs-on : ubuntu-latest
16
-
16
+ strategy :
17
+ matrix :
18
+ rust :
19
+ - version : 1.65.0 # STABLE
20
+ clippy : true
21
+ - version : 1.57.0 # MSRV
22
+ features :
23
+ - default
24
+ - blocking
25
+ - async
26
+ - async-https
17
27
steps :
18
28
- uses : actions/checkout@v3
19
- - name : Install rustup
20
- run : curl https://sh.rustup.rs -sSf | sh -s -- -y
29
+ - name : Generate cache key
30
+ run : echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
31
+ - name : cache
32
+ uses : actions/cache@v3
33
+ with :
34
+ path : |
35
+ ~/.cargo/registry
36
+ ~/.cargo/git
37
+ target
38
+ key : ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
21
39
- name : Set default toolchain
22
- run : $HOME/.cargo/bin/ rustup default stable
40
+ run : rustup default ${{ matrix.rust.version }}
23
41
- name : Set profile
24
- run : $HOME/.cargo/bin/rustup set profile minimal
25
- - name : Fmt
26
- run : cargo fmt -- --check --verbose
42
+ run : rustup set profile minimal
43
+ - name : Add clippy
44
+ if : ${{ matrix.rust.clippy }}
45
+ run : rustup component add clippy
46
+ - name : Update toolchain
47
+ run : rustup update
27
48
- name : Build
28
- run : cargo build --verbose --all-features
29
- - name : Test all features
30
- run : cargo test --verbose --all-features -- --test-threads=1
31
- - name : Check only blocking feature
32
- run : cargo check --verbose --no-default-features --features=blocking
33
- - name : Check only async features
34
- run : cargo check --verbose --no-default-features --features=async
35
- - name : Check only async-http feature
36
- run : cargo check --verbose --no-default-features --features=async-https
49
+ run : cargo build --features ${{ matrix.features }} --no-default-features
37
50
- name : Clippy
38
- run : cargo clippy --all-targets --all-features -- -D warnings
51
+ if : ${{ matrix.rust.clippy }}
52
+ run : cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
53
+ - name : Test
54
+ run : cargo test --features ${{ matrix.features }} --no-default-features
0 commit comments