@@ -2,6 +2,11 @@ name: 'Rust Base CI'
22on :
33 workflow_call :
44 inputs :
5+ test-all-features :
6+ description : ' Test with all features enabled'
7+ required : false
8+ default : true
9+ type : boolean
510 rust-channel :
611 description : ' Rust channel to use'
712 required : false
3641 SSH_PRIVATE_KEY :
3742 description : ' SSH private key for fetching private dependencies'
3843 required : false
39- SSH_PRIVATE_KEY_2 :
44+ SSH_PRIVATE_KEY_2 :
4045 description : ' SSH private key for fetching private dependencies'
4146 required : false
4247 SSH_PRIVATE_KEY_3 :
4550jobs :
4651 test :
4752 name : Test Suite
48- runs-on :
53+ runs-on :
4954 group : init4-runners
5055 steps :
5156 - name : Checkout repository
5560 uses :
webfactory/[email protected] 5661 with :
5762 ssh-private-key : |
58- ${{ secrets.SSH_PRIVATE_KEY }}
63+ ${{ secrets.SSH_PRIVATE_KEY }}
5964 ${{ secrets.SSH_PRIVATE_KEY_2 }}
6065 ${{ secrets.SSH_PRIVATE_KEY_3 }}
6166 - name : Install Rust toolchain
@@ -69,18 +74,18 @@ jobs:
6974 version : nightly
7075 - if : ${{ inputs.require-lockfile == true }}
7176 name : Run tests
72- env :
77+ env :
7378 CARGO_NET_GIT_FETCH_WITH_CLI : true
7479 CARGO_BUILD_JOBS : ${{ inputs.cargo-build-jobs }}
7580 run : |
76- cargo nextest run -- all-features --workspace --locked --cargo-profile ${{ inputs.rust-profile }} --no-tests=warn
81+ cargo nextest run ${{ inputs.test-all-features && '-- all-features' || '' }} --workspace --locked --cargo-profile ${{ inputs.rust-profile }} --no-tests=warn
7782 - if : ${{ inputs.require-lockfile == false }}
7883 name : Run tests
79- env :
84+ env :
8085 CARGO_NET_GIT_FETCH_WITH_CLI : true
8186 CARGO_BUILD_JOBS : ${{ inputs.cargo-build-jobs }}
8287 run : |
83- cargo nextest run -- all-features --workspace --cargo-profile ${{ inputs.rust-profile }} --no-tests=warn
88+ cargo nextest run ${{ inputs.test-all-features && '-- all-features' || '' }} --workspace --cargo-profile ${{ inputs.rust-profile }} --no-tests=warn
8489
8590 # We need a separate job for doctests because they are not run in the main test job with nextest.
8691 doctest :
@@ -93,11 +98,11 @@ jobs:
9398 - uses : Swatinem/rust-cache@v2
9499 with :
95100 cache-on-failure : true
96- - run : cargo test --workspace --doc
101+ - run : cargo test --workspace --doc ${{ inputs.test-all-features && '--all-features' || '' }}
97102
98103 rustfmt :
99104 name : Rustfmt
100- runs-on :
105+ runs-on :
101106 group : init4-runners
102107 steps :
103108 - name : Checkout repository
@@ -108,13 +113,13 @@ jobs:
108113 components : rustfmt
109114 - uses : Swatinem/rust-cache@v2
110115 - name : Check formatting
111- env :
116+ env :
112117 CARGO_NET_GIT_FETCH_WITH_CLI : true
113118 run : cargo fmt --all --check
114119
115120 clippy :
116121 name : Clippy
117- runs-on :
122+ runs-on :
118123 group : init4-runners
119124 steps :
120125 - name : Checkout repository
@@ -124,7 +129,7 @@ jobs:
124129 uses :
webfactory/[email protected] 125130 with :
126131 ssh-private-key : |
127- ${{ secrets.SSH_PRIVATE_KEY }}
132+ ${{ secrets.SSH_PRIVATE_KEY }}
128133 ${{ secrets.SSH_PRIVATE_KEY_2 }}
129134 ${{ secrets.SSH_PRIVATE_KEY_3 }}
130135 - name : Install Rust toolchain
@@ -134,18 +139,18 @@ jobs:
134139 - uses : Swatinem/rust-cache@v2
135140 - if : ${{ inputs.require-lockfile == true }}
136141 name : Clippy check
137- env :
142+ env :
138143 CARGO_NET_GIT_FETCH_WITH_CLI : true
139144 run : cargo clippy --all-targets --all-features --workspace --locked --profile ${{ inputs.rust-profile }} -- -D warnings
140145 - if : ${{ inputs.require-lockfile == false }}
141146 name : Clippy check
142- env :
147+ env :
143148 CARGO_NET_GIT_FETCH_WITH_CLI : true
144149 run : cargo clippy --all-targets --all-features --workspace --profile ${{ inputs.rust-profile }} -- -D warnings
145150
146151 docs :
147152 name : Docs
148- runs-on :
153+ runs-on :
149154 group : init4-runners
150155 steps :
151156 - name : Checkout repository
@@ -155,7 +160,7 @@ jobs:
155160 uses :
webfactory/[email protected] 156161 with :
157162 ssh-private-key : |
158- ${{ secrets.SSH_PRIVATE_KEY }}
163+ ${{ secrets.SSH_PRIVATE_KEY }}
159164 ${{ secrets.SSH_PRIVATE_KEY_2 }}
160165 ${{ secrets.SSH_PRIVATE_KEY_3 }}
161166 - name : Install Rust toolchain
0 commit comments