diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a581830..fe95fc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,3 +58,22 @@ 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 + env: + RUSTFLAGS: '-D warnings' + 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(" ")')" + 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