mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 12:30:35 +00:00
Get rustdoc
flags from Cargo.toml
.
This commit is contained in:
parent
21dc2dd490
commit
52afb90219
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
@ -9,7 +9,7 @@ on:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUSTFLAGS: '-D warnings'
|
||||
RUSTFLAGS: "-D warnings"
|
||||
|
||||
jobs:
|
||||
# Run MIRI tests on nightly
|
||||
@ -182,11 +182,6 @@ jobs:
|
||||
doc:
|
||||
name: doc
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- thumbv7m-none-eabi
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -213,14 +208,40 @@ jobs:
|
||||
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||
${{ runner.OS }}-build-
|
||||
|
||||
- name: Install nightly Rust with target (${{ matrix.target }})
|
||||
- name: Get metadata
|
||||
id: metadata
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
docsrs_metadata="$(cargo metadata --format-version 1 | jq '.packages[] | select(.name == "heapless") | .metadata.docs.rs')"
|
||||
features=($(jq --raw-output '.features[]' <<< "${docsrs_metadata}"))
|
||||
rustdocflags=(-D warnings --cfg docsrs $(jq --raw-output '.["rustdoc-args"][]' <<< "${docsrs_metadata}"))
|
||||
targets=($(jq --raw-output '.targets[]' <<< "${docsrs_metadata}"))
|
||||
|
||||
echo "features=${features[*]}" >> "${GITHUB_OUTPUT}"
|
||||
echo "rustdocflags=${rustdocflags[*]}" >> "${GITHUB_OUTPUT}"
|
||||
echo "targets=${targets[*]}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Install nightly Rust with targets (${{ steps.metadata.outputs.targets }})
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
targets: ${{ steps.metadata.outputs.targets }}
|
||||
|
||||
- name: cargo rustdoc
|
||||
env: {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"}
|
||||
run: cargo rustdoc --target=${{ matrix.target }} --features="alloc bytes defmt mpmc_large portable-atomic-critical-section serde ufmt"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
targets=(${targets})
|
||||
|
||||
for target in "${targets[@]}"; do
|
||||
set -x
|
||||
cargo rustdoc --target "${target}" --features "${features}"
|
||||
set +x
|
||||
done
|
||||
env:
|
||||
features: ${{ steps.metadata.outputs.features }}
|
||||
RUSTDOCFLAGS: ${{ steps.metadata.outputs.rustdocflags }}
|
||||
targets: ${{ steps.metadata.outputs.targets }}
|
||||
|
||||
# Run cpass tests
|
||||
testcpass:
|
||||
|
Loading…
x
Reference in New Issue
Block a user