9
9
10
10
env :
11
11
CARGO_TERM_COLOR : always
12
- RUSTFLAGS : ' -D warnings'
12
+ RUSTFLAGS : " -D warnings"
13
13
14
14
jobs :
15
15
# Run MIRI tests on nightly
@@ -182,11 +182,6 @@ jobs:
182
182
doc :
183
183
name : doc
184
184
runs-on : ubuntu-latest
185
- strategy :
186
- matrix :
187
- target :
188
- - x86_64-unknown-linux-gnu
189
- - thumbv7m-none-eabi
190
185
steps :
191
186
- name : Checkout
192
187
uses : actions/checkout@v4
@@ -213,14 +208,40 @@ jobs:
213
208
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
214
209
${{ runner.OS }}-build-
215
210
216
- - name : Install nightly Rust with target (${{ matrix.target }})
211
+ - name : Get metadata
212
+ id : metadata
213
+ run : |
214
+ set -euo pipefail
215
+
216
+ docsrs_metadata="$(cargo metadata --format-version 1 | jq '.packages[] | select(.name == "heapless") | .metadata.docs.rs')"
217
+ features=($(jq --raw-output '.features[]' <<< "${docsrs_metadata}"))
218
+ rustdocflags=(-D warnings --cfg docsrs $(jq --raw-output '.["rustdoc-args"][]' <<< "${docsrs_metadata}"))
219
+ targets=($(jq --raw-output '.targets[]' <<< "${docsrs_metadata}"))
220
+
221
+ echo "features=${features[*]}" >> "${GITHUB_OUTPUT}"
222
+ echo "rustdocflags=${rustdocflags[*]}" >> "${GITHUB_OUTPUT}"
223
+ echo "targets=${targets[*]}" >> "${GITHUB_OUTPUT}"
224
+
225
+ - name : Install nightly Rust with targets (${{ steps.metadata.outputs.targets }})
217
226
uses : dtolnay/rust-toolchain@nightly
218
227
with :
219
- targets : ${{ matrix.target }}
228
+ targets : ${{ steps.metadata.outputs.targets }}
220
229
221
230
- name : cargo rustdoc
222
- env : {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"}
223
- run : cargo rustdoc --target=${{ matrix.target }} --features="alloc bytes defmt mpmc_large portable-atomic-critical-section serde ufmt"
231
+ run : |
232
+ set -euo pipefail
233
+
234
+ targets=(${targets})
235
+
236
+ for target in "${targets[@]}"; do
237
+ set -x
238
+ cargo rustdoc --target "${target}" --features "${features}"
239
+ set +x
240
+ done
241
+ env :
242
+ features : ${{ steps.metadata.outputs.features }}
243
+ RUSTDOCFLAGS : ${{ steps.metadata.outputs.rustdocflags }}
244
+ targets : ${{ steps.metadata.outputs.targets }}
224
245
225
246
# Run cpass tests
226
247
testcpass :
0 commit comments