@@ -2,19 +2,18 @@ name: Rust
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 paths-ignore :
7- - ' **.md'
7+ - " **.md"
88 pull_request :
9- branches : [ main ]
9+ branches : [main]
1010 paths-ignore :
11- - ' **.md'
11+ - " **.md"
1212
1313env :
1414 CARGO_TERM_COLOR : always
1515
1616jobs :
17- # Check code formatting (fast, separate job)
1817 format :
1918 name : Format
2019 runs-on : ubuntu-latest
2423 - name : Check formatting
2524 run : cargo fmt --check
2625
27- # Check compilation with different features
2826 check :
2927 name : Check
3028 runs-on : ubuntu-latest
4038 - name : Check with no features
4139 run : cargo check --no-default-features
4240
43- # Run clippy linting
4441 clippy :
4542 name : Clippy
4643 runs-on : ubuntu-latest
@@ -56,11 +53,10 @@ jobs:
5653 - name : Clippy with default features
5754 run : cargo clippy -- -D warnings
5855
59- # Build with different feature combinations
6056 build :
6157 name : Build
6258 runs-on : ubuntu-latest
63- needs : [ check, clippy ]
59+ needs : [check, clippy]
6460 steps :
6561 - uses : actions/checkout@v4
6662
7773 run : |
7874 cargo build --no-default-features --features http,gz,bz,native-tls
7975 # Check if rustls is actually used in the dependency tree
80- rustls_count=$(cargo tree --no-default-features --features http,gz,bz,native-tls 2>/dev/null | grep -c "rustls v" || echo "0")
76+ rustls_count=$(
77+ cargo tree --no-default-features --features http,gz,bz,native-tls 2>/dev/null \
78+ | grep -c "rustls v" \
79+ || echo "0"
80+ )
8181 if [ "$rustls_count" -gt 0 ]; then
8282 echo "ERROR: rustls crate found $rustls_count times in dependencies when using native-tls"
8383 cargo tree --no-default-features --features http,gz,bz,native-tls 2>/dev/null | grep "rustls v"
8989 run : |
9090 cargo build --no-default-features --features http,gz,bz,rustls
9191 # Check if native-tls is actually used in the dependency tree
92- natls_count=$(cargo tree --no-default-features --features http,gz,bz,rustls 2>/dev/null | grep -c "native-tls v" || echo "0")
92+ natls_count=$(
93+ cargo tree --no-default-features --features http,gz,bz,rustls 2>/dev/null \
94+ | grep -c "native-tls v" \
95+ || echo "0"
96+ )
9397 if [ "$natls_count" -gt 0 ]; then
9498 echo "ERROR: native-tls crate found $natls_count times in dependencies when using rustls"
9599 cargo tree --no-default-features --features http,gz,bz,rustls 2>/dev/null | grep "native-tls v"
@@ -117,7 +121,6 @@ jobs:
117121 - name : Build async feature
118122 run : cargo build --no-default-features --features async,http,gz,rustls
119123
120- # Run tests
121124 test :
122125 name : Test
123126 runs-on : ubuntu-latest
0 commit comments