summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 4b263a826f89f237d8268904b2d98ab66877e224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build all driver samples
on:
  # Allows the workflow to be triggered manually from the Actions tab ("Run workflow").
  workflow_dispatch:
  push:
    branches:
      - main
      - develop
    paths-ignore:
      - '**.md'
      - 'LICENSE'
  schedule:
    # Runs every Saturday at 00:00 PST (08:00 UTC)
    - cron: '0 8 * * 6'
jobs:
  # Auto-discover the available _NT_TARGET_VERSION values from the active WDK so the build
  # matrix never needs a hand-maintained version list. Change -Newest to build more/fewer.
  discover:
    name: discover _NT_TARGET_VERSIONs
    runs-on: windows-2025-vs2026
    outputs:
      versions: ${{ steps.nt.outputs.versions }}
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4

      - name: Install Nuget Packages
        run: nuget restore .\packages.config -PackagesDirectory .\packages\

      - name: Discover the newest _NT_TARGET_VERSION values
        id: nt
        shell: pwsh
        run: |
          $json = .\Get-NtTargetVersions.ps1 -Newest 4 -AsMatrixJson
          "versions=$json" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
          Write-Host "Discovered _NT_TARGET_VERSION matrix: $json"

  build:
    name: build ${{ matrix.nt.tag }} ${{ matrix.configuration }} ${{ matrix.platform }}
    needs: discover
    strategy:
      fail-fast: false
      matrix:
        configuration: [Debug, Release]
        platform: [x64, arm64]
        # _NT_TARGET_VERSION values are auto-discovered by the 'discover' job from the active
        # WDK, so there is no version list to maintain here.
        nt: ${{ fromJSON(needs.discover.outputs.versions) }}
    runs-on: windows-2025-vs2026
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
        with:
          submodules: 'recursive'

      - name: Install Nuget Packages
        run: nuget restore .\packages.config -PackagesDirectory .\packages\

      - name: Retrieve and build all available solutions
        run: .\Build-Samples.ps1 -Verbose
        env:
          WDS_Configuration: ${{ matrix.configuration }}
          WDS_Platform: ${{ matrix.platform }}
          WDS_NtTargetVersion: ${{ matrix.nt.version }}
          WDS_ReportFileName: _overview.${{ matrix.nt.tag }}.${{ matrix.configuration }}.${{ matrix.platform }}

      - name: Archive build logs and overview build reports
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: logs-${{ matrix.nt.tag }}-${{ matrix.configuration }}-${{ matrix.platform }}
          path: _logs

  report:
    name: Generate global report
    runs-on: windows-2022
    needs: build
    if: always()
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4

      - name: Retrieve overview reports
        uses: actions/download-artifact@v4
        with:
          path: _logs
          pattern: logs-*
          merge-multiple: true

      - name: Join and generate global reports
        run: .\.github\scripts\Join-CsvReports.ps1

      - name: Archive global overview build reports
        uses: actions/upload-artifact@v4
        with:
          name: logs
          path: _logs/_overview.all.*