From 6e143ce2a108a357e4facaf920d84ba584c14aae Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 20 Apr 2025 19:43:32 -0700 Subject: [PATCH] Add CI job to check API docs This ensures that `cargo doc` does not generate any warnings. --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f1f4378..64f4c946 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,6 +98,18 @@ jobs: - run: rustup component add clippy - run: cargo clippy --workspace --all-targets --no-deps -- -D warnings + docs: + name: Check API docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu + - name: Ensure intradoc links are valid + run: cargo doc --workspace --document-private-items --no-deps + env: + RUSTDOCFLAGS: -D warnings + # The success job is here to consolidate the total success/failure state of # all other jobs. This job is then included in the GitHub branch protection # rule which prevents merges unless all other jobs are passing. This makes @@ -112,6 +124,7 @@ jobs: - aarch64-cross-builds - gui - clippy + - docs runs-on: ubuntu-latest steps: - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'