name: docs

env:
  RUST_BACKTRACE: 1

jobs:
  docsrs:
    name: cargo doc --cfg docsrs
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: '--cfg=docsrs -Dwarnings'
    steps:
    - uses: actions/checkout@v4
    - uses: actions-rust-lang/setup-rust-toolchain@v1
      with:
        toolchain: nightly
    - run: cargo doc --all-features --no-deps

on:
  merge_group:
    types: [checks_requested]
  pull_request:
    branches: [main]
    types: [opened, synchronize, reopened, ready_for_review]
