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:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUSTFLAGS: '-D warnings'
|
RUSTFLAGS: "-D warnings"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Run MIRI tests on nightly
|
# Run MIRI tests on nightly
|
||||||
@ -182,11 +182,6 @@ jobs:
|
|||||||
doc:
|
doc:
|
||||||
name: doc
|
name: doc
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target:
|
|
||||||
- x86_64-unknown-linux-gnu
|
|
||||||
- thumbv7m-none-eabi
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -213,14 +208,40 @@ jobs:
|
|||||||
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
${{ runner.OS }}-build-
|
${{ 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
|
uses: dtolnay/rust-toolchain@nightly
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ steps.metadata.outputs.targets }}
|
||||||
|
|
||||||
- name: cargo rustdoc
|
- name: cargo rustdoc
|
||||||
env: {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"}
|
run: |
|
||||||
run: cargo rustdoc --target=${{ matrix.target }} --features="alloc bytes defmt mpmc_large portable-atomic-critical-section serde ufmt"
|
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
|
# Run cpass tests
|
||||||
testcpass:
|
testcpass:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user