From b8d013dc11694ed55e3000fdd9604dcf0b6ba5c9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 12 Jul 2024 06:55:40 +0200 Subject: [PATCH] Add a test that call cargo doc for many crates in the ecosystem I expect this to fail for now since we have a bug --- .github/workflows/rust.yml | 55 +++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c85b8f5..d0a99b0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,26 +22,55 @@ jobs: - nightly steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - name: Run tests run: cargo test --verbose --all-features - name: Run docs - run: cargo doc --verbose + run: cargo doc --verbose format: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable - name: Run rustfmt run: cargo fmt --all -- --check + + + crater: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: setup patch + run: | + echo "" >> ~/.cargo/config.toml + echo [patch.crates-io] >> ~/.cargo/config.toml + echo document-features = { path = \"$GITHUB_WORKSPACE\" } >> ~/.cargo/config.toml + - name: create project and generate docs + run: | + cd ~ + cargo new crater + cd crater + cargo add quick-xml -F document-features + cargo add serde_with -F guide + cargo add serial_test -F document-features + cargo add wpu-core + cargo add wpu + cargo add gix -F document-features + cargo add kstring -F document-features + cargo add ratatui -F document-features + cargo add re_types + cargo add slint -F document-features + cargo add egui-winit -F document-features + cargo add ehttp + cargo add snapbox -F document-features + cargo add fast-image-resize + cargo add rhai -F document-features + cargo add embassy-executor + cargo add embassy-time + + cargo doc + not grep -r "No documented features in Cargo.toml" target/doc