From 39075bb641f340d85175328249ba97aac0b16e04 Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 29 Nov 2023 21:15:45 +0900 Subject: [PATCH] run `cargo doc` check on CI --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a581830..6396f1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,3 +58,20 @@ jobs: - run: cargo clippy --examples --tests --no-default-features --features tuirs-no-backend -- -D warnings - run: cargo clippy --examples --tests --no-default-features --features tuirs-no-backend,search -- -D warnings - run: cargo rustdoc --features=search,termwiz,termion -p tui-textarea -- -D warnings + cargo-doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - name: Run `cargo doc` with same configuration as docs.rs + run: | + set -e + md="$(cargo metadata --format-version=1 | jq '.packages[] | select(.name=="tui-textarea") | .metadata.docs.rs')" + export RUSTDOCFLAGS="$(echo "$md" | jq -r '.["rustdoc-args"] | join(" ")') -D warnings" + features="$(echo "$md" | jq -r '.features | join(",")')" + set -x + for target in $(echo "$md" | jq -r '.targets | join(" ")') + do + rustup target add "$target" + cargo doc -p tui-textarea "--features=$features" "--target=$target" + done