Skip to content

Docs

Docs #783

Workflow file for this run

name: Docs
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: '0 11 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
RUSTDOCFLAGS: -D warnings
jobs:
docs:
name: Docs
strategy:
fail-fast: false # Allow all matrix variants to complete even if some fail
matrix:
runner:
- name: windows-latest
arch: amd64
- name: windows-11-arm
arch: arm64
wdk:
- version: 10.0.22621 # NI WDK
source: winget
- version: 10.0.26100 # GE WDK
source: nuget
llvm:
- 17.0.6
rust_toolchain:
- stable
- beta
- nightly
cargo_profile:
- dev
- release
target_triple:
- name: x86_64-pc-windows-msvc
arch: amd64
- name: aarch64-pc-windows-msvc
arch: arm64
runs-on: ${{ matrix.runner.name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Checkout windows-drivers-rs actions
uses: actions/checkout@v4
with:
repository: microsoft/windows-drivers-rs
ref: main
path: _temp/windows-drivers-rs
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
- name: Copy actions to workspace
shell: pwsh
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
- name: Install Winget
uses: ./.github/actions/install-winget
with:
# windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95).
force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }}
- name: Install LLVM ${{ matrix.llvm }}
uses: ./.github/actions/install-llvm
with:
version: ${{ matrix.llvm }}
- name: Install WDK (${{ matrix.wdk.version }})
uses: ./.github/actions/install-wdk
with:
version: ${{ matrix.wdk.version }}
source: ${{ matrix.wdk.source }}
host: ${{ matrix.wdk.source == 'nuget' && matrix.runner.arch || '' }}
target: ${{ matrix.wdk.source == 'nuget' && matrix.target_triple.arch || '' }}
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: ${{ matrix.target_triple.name }}
- name: Run Cargo Doc
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros
- name: Run Cargo Doc (--features nightly)
if: matrix.rust_toolchain == 'nightly'
# proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros --features nightly
- name: Run Cargo Doc w/ proc-macro crates
# Skip duplicate runs on the same runner
if: matrix.target_triple.arch == matrix.runner.arch
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }}
- name: Run Cargo Doc w/ proc-macro crates (--features nightly)
# Skip duplicate runs on the same runner
if: ${{ matrix.target_triple.arch == matrix.runner.arch && matrix.rust_toolchain == 'nightly' }}
# cargo doc can only generate documentation for proc-macro crates when --target is not specified due to a cargo doc bug: https://github.com/rust-lang/cargo/issues/7677
run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly