Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Rustdoc

on:
push:
branches: ["main"]
paths:
- ".github/workflows/rustdoc.yml"
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
- "quicklendx-contracts/**"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/rustdoc.yml"
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
- "quicklendx-contracts/**"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
cargo-doc:
name: cargo doc (${{ matrix.package.name }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
package:
- name: root contract crate
working-directory: .
- name: quicklendx-contracts
working-directory: quicklendx-contracts

steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup show

- name: Generate package rustdoc
working-directory: ${{ matrix.package.working-directory }}
run: |
source "$HOME/.cargo/env"
cargo doc --no-deps --locked
14 changes: 14 additions & 0 deletions docs/RUSTDOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ The published URL is updated automatically on every tag push — no manual step

If the published URL returns a 404, the most likely cause is that no tag has been pushed yet for the current development cycle. Generate the docs locally using the command above, or check the repository's Actions tab to confirm the publish workflow ran successfully.

## Pull request validation

Every push to `main` and every pull request that touches contract sources,
Cargo metadata, or the rustdoc workflow runs `.github/workflows/rustdoc.yml`.
That workflow checks each contract package independently:

| Package | Working directory | Command |
|---|---|---|
| Root contract crate | `.` | `cargo doc --no-deps --locked` |
| Smart contract package | `quicklendx-contracts/` | `cargo doc --no-deps --locked` |

The matrix keeps rustdoc failures scoped to the package that introduced them
and prevents a healthy package from hiding a broken API surface in another one.

---

## Related documentation
Expand Down
Loading