diff options
| author | 5an7y <[email protected]> | 2026-06-23 10:38:40 -0700 |
|---|---|---|
| committer | 5an7y <[email protected]> | 2026-06-23 10:38:40 -0700 |
| commit | ceceab78412feefd2f343a0e3bc07f1262665b62 (patch) | |
| tree | 046ae1a9f147f5be0fec14f8cd7b9c97a8791296 /.github/workflows | |
| parent | be91bbd2dc4478a57a4007fc32fe320da79f85e1 (diff) | |
Auto-discover _NT_TARGET_VERSION; remove the TargetVersion axis
- Remove the -TargetVersion parameter and all its plumbing from Build-Samples.ps1 (restoring
the original hard-coded -p:TargetVersion=Windows10), and drop the TargetVersions column from
exclusions.csv and Import-SampleExclusions. Only _NT_TARGET_VERSION remains exposed.
- Add Get-NtTargetVersions.ps1, which auto-discovers the valid _NT_TARGET_VERSION values (and
their NTDDI codes) by parsing the active WDK's DriverGeneral.xml rule. Build-Samples.ps1 uses
it to validate -NtTargetVersion, default to the latest, and map to the msbuild code, so a new
WDK version needs no script change (accepts '10.0.<build>' or the short '<build>' tag).
- CI: ci.yml and ci-pr.yml gain a 'discover' job that emits the newest-N versions as JSON; the
build matrix consumes it via fromJSON, so there is no hand-maintained version list anywhere.
Build-ChangedSamples.ps1 treats Get-NtTargetVersions.ps1 as a full-build trigger.
- Docs updated accordingly.
Co-authored-by: Copilot <[email protected]>
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci-pr.yml | 33 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 33 |
2 files changed, 52 insertions, 14 deletions
diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 7983c8dd..8119c94c 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -8,20 +8,39 @@ on: - '**.md' - 'LICENSE' 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 = the WDK library version drivers link against (newest first). - # Each { version, tag } runs as its own parallel job; trim this list to reduce CI load. - nt: - - { version: '10.0.28000', tag: '28000' } - - { version: '10.0.26100', tag: '26100' } - - { version: '10.0.22621', tag: '22621' } - - { version: '10.0.22000', tag: '22000' } + # _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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 022ae4f6..de856d55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,20 +11,39 @@ on: # 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 = the WDK library version drivers link against (newest first). - # Each { version, tag } runs as its own parallel job; trim this list to reduce CI load. - nt: - - { version: '10.0.28000', tag: '28000' } - - { version: '10.0.26100', tag: '26100' } - - { version: '10.0.22621', tag: '22621' } - - { version: '10.0.22000', tag: '22000' } + # _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 |
