From ec9eb50bd55d9f9873941001d1c89ae39c6755a2 Mon Sep 17 00:00:00 2001 From: plebhash Date: Thu, 5 Dec 2024 17:25:04 +0700 Subject: [PATCH] enforce missing_docs macro in CI --- .github/workflows/rust-docs.yaml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/rust-docs.yaml diff --git a/.github/workflows/rust-docs.yaml b/.github/workflows/rust-docs.yaml new file mode 100644 index 0000000000..b47d7bc68b --- /dev/null +++ b/.github/workflows/rust-docs.yaml @@ -0,0 +1,35 @@ +name: Validate Rust Docs + +on: + push: + branches: + - main + pull_request: + +jobs: + generate-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Find and Document All Crates + run: | + # Fail on any error + set -e + + # Find all Cargo.toml files (crates) and run `cargo doc` for each + find . -name "Cargo.toml" | while read -r crate; do + crate_dir=$(dirname "$crate") + echo "Generating documentation for $crate_dir..." + ( + cd "$crate_dir" || exit 1 + cargo doc --all-features --no-deps + ) + done \ No newline at end of file