|
| 1 | +name: Docs |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + merge_group: |
| 7 | + schedule: # Trigger a job on default branch at 4AM PST everyday |
| 8 | + - cron: '0 11 * * *' |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }} |
| 12 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 13 | + |
| 14 | +env: |
| 15 | + RUSTDOCFLAGS: -D warnings |
| 16 | + |
| 17 | +jobs: |
| 18 | + docs: |
| 19 | + name: Docs |
| 20 | + strategy: |
| 21 | + fail-fast: false # Allow all matrix variants to complete even if some fail |
| 22 | + matrix: |
| 23 | + runner: |
| 24 | + - name: windows-latest |
| 25 | + arch: amd64 |
| 26 | + - name: windows-11-arm |
| 27 | + arch: arm64 |
| 28 | + |
| 29 | + wdk: |
| 30 | + - version: 10.0.22621 # NI WDK |
| 31 | + source: winget |
| 32 | + - version: 10.0.26100 # GE WDK |
| 33 | + source: nuget |
| 34 | + |
| 35 | + llvm: |
| 36 | + - 17.0.6 |
| 37 | + |
| 38 | + rust_toolchain: |
| 39 | + - stable |
| 40 | + - beta |
| 41 | + - nightly |
| 42 | + |
| 43 | + cargo_profile: |
| 44 | + - dev |
| 45 | + - release |
| 46 | + |
| 47 | + target_triple: |
| 48 | + - name: x86_64-pc-windows-msvc |
| 49 | + arch: amd64 |
| 50 | + - name: aarch64-pc-windows-msvc |
| 51 | + arch: arm64 |
| 52 | + |
| 53 | + runs-on: ${{ matrix.runner.name }} |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout Repository |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Checkout windows-drivers-rs actions |
| 60 | + uses: actions/checkout@v4 |
| 61 | + with: |
| 62 | + repository: microsoft/windows-drivers-rs |
| 63 | + ref: main |
| 64 | + path: _temp/windows-drivers-rs |
| 65 | + sparse-checkout: | |
| 66 | + .github/actions |
| 67 | + sparse-checkout-cone-mode: false |
| 68 | + |
| 69 | + - name: Copy actions to workspace |
| 70 | + shell: pwsh |
| 71 | + run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/ |
| 72 | + |
| 73 | + - name: Install Winget |
| 74 | + uses: ./.github/actions/install-winget |
| 75 | + with: |
| 76 | + # windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95). |
| 77 | + force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }} |
| 78 | + |
| 79 | + - name: Install LLVM ${{ matrix.llvm }} |
| 80 | + uses: ./.github/actions/install-llvm |
| 81 | + with: |
| 82 | + version: ${{ matrix.llvm }} |
| 83 | + |
| 84 | + - name: Install WDK (${{ matrix.wdk.version }}) |
| 85 | + uses: ./.github/actions/install-wdk |
| 86 | + with: |
| 87 | + version: ${{ matrix.wdk.version }} |
| 88 | + source: ${{ matrix.wdk.source }} |
| 89 | + host: ${{ matrix.wdk.source == 'nuget' && matrix.runner.arch || '' }} |
| 90 | + target: ${{ matrix.wdk.source == 'nuget' && matrix.target_triple.arch || '' }} |
| 91 | + |
| 92 | + - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) |
| 93 | + uses: dtolnay/rust-toolchain@master |
| 94 | + with: |
| 95 | + toolchain: ${{ matrix.rust_toolchain }} |
| 96 | + targets: ${{ matrix.target_triple.name }} |
| 97 | + |
| 98 | + - name: Run Cargo Doc |
| 99 | + # proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368 |
| 100 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros |
| 101 | + - name: Run Cargo Doc (--features nightly) |
| 102 | + if: matrix.rust_toolchain == 'nightly' |
| 103 | + # proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368 |
| 104 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --exclude wdk-macros --features nightly |
| 105 | + - name: Run Cargo Doc w/ proc-macro crates |
| 106 | + # Skip duplicate runs on the same runner |
| 107 | + if: matrix.target_triple.arch == matrix.runner.arch |
| 108 | + # 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 |
| 109 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} |
| 110 | + |
| 111 | + - name: Run Cargo Doc w/ proc-macro crates (--features nightly) |
| 112 | + # Skip duplicate runs on the same runner |
| 113 | + if: ${{ matrix.target_triple.arch == matrix.runner.arch && matrix.rust_toolchain == 'nightly' }} |
| 114 | + # 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 |
| 115 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly |
0 commit comments