|
| 1 | +on: |
| 2 | + push: |
| 3 | + pull_request: |
| 4 | + merge_group: |
| 5 | + schedule: # Trigger a job on default branch at 4AM PST everyday |
| 6 | + - cron: "0 11 * * *" |
| 7 | + |
| 8 | +name: Docs |
| 9 | + |
| 10 | +jobs: |
| 11 | + docs: |
| 12 | + name: Docs |
| 13 | + runs-on: windows-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + wdk: |
| 17 | + - Microsoft.WindowsWDK.10.0.22621 # NI WDK |
| 18 | + |
| 19 | + rust_toolchain: |
| 20 | + - stable |
| 21 | + - beta |
| 22 | + - nightly |
| 23 | + |
| 24 | + cargo_profile: |
| 25 | + - dev |
| 26 | + - release |
| 27 | + |
| 28 | + target_triple: |
| 29 | + - x86_64-pc-windows-msvc |
| 30 | + - aarch64-pc-windows-msvc |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout Repository |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Install Winget |
| 37 | + uses: ./.github/actions/winget-install |
| 38 | + with: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + - name: Install WDK (${{ matrix.wdk }}) |
| 42 | + run: | |
| 43 | + if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) { |
| 44 | + winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }} |
| 45 | + } |
| 46 | +
|
| 47 | + - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) |
| 48 | + uses: dtolnay/rust-toolchain@master |
| 49 | + with: |
| 50 | + toolchain: ${{ matrix.rust_toolchain }} |
| 51 | + targets: ${{ matrix.target_triple }} |
| 52 | + |
| 53 | + - name: Run Cargo Doc |
| 54 | + # proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368 |
| 55 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros |
| 56 | + |
| 57 | + - name: Run Cargo Doc (--features nightly) |
| 58 | + if: matrix.rust_toolchain == 'nightly' |
| 59 | + # proc-macro crates must be excluded to avoid cargo doc bug: https://github.com/rust-lang/cargo/issues/10368 |
| 60 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple }} --workspace --exclude wdk-macros --features nightly |
| 61 | + |
| 62 | + - name: Run Cargo Doc w/ proc-macro crates |
| 63 | + if: matrix.target_triple == 'x86_64-pc-windows-msvc' |
| 64 | + # 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 |
| 65 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} |
| 66 | + |
| 67 | + - name: Run Cargo Doc w/ proc-macro crates (--features nightly) |
| 68 | + if: ${{ matrix.target_triple == 'x86_64-pc-windows-msvc' && matrix.rust_toolchain == 'nightly' }} |
| 69 | + # 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 |
| 70 | + run: cargo +${{ matrix.rust_toolchain }} doc --locked --profile ${{ matrix.cargo_profile }} --features nightly |
0 commit comments