forked from ge9/IddSampleDriver
-
-
Notifications
You must be signed in to change notification settings - Fork 366
149 lines (121 loc) · 4.88 KB
/
ci-validation.yml
File metadata and controls
149 lines (121 loc) · 4.88 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Fast CI Validation
on:
pull_request:
branches: [ main, master ]
push:
branches: [ main, master ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE*'
env:
BUILD_CONFIGURATION: Release
permissions:
contents: read
jobs:
validate:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Install Windows Driver Kit (WDK)
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
choco install windowsdriverkit11 -y --no-progress
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Detect Windows Kits version (UMDF headers)
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$kitsRoot = $null
try {
$kitsRoot = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10
} catch {
$kitsRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\"
}
if (-not $kitsRoot -or -not (Test-Path $kitsRoot)) {
throw "Windows Kits root not found: $kitsRoot"
}
$includeRoot = Join-Path $kitsRoot "Include"
if (-not (Test-Path $includeRoot)) {
throw "Windows Kits Include directory not found: $includeRoot"
}
$candidates =
Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue |
Where-Object { Test-Path (Join-Path $_.FullName "wdf\umdf\wudfwdm.h") } |
Sort-Object -Property Name -Descending
$best = $candidates | Select-Object -First 1
if (-not $best) {
throw "Could not find wdf\\umdf\\wudfwdm.h under: $includeRoot"
}
$kitVersion = $best.Name
$windowsSdkDir = $kitsRoot
Write-Output "Using WindowsTargetPlatformVersion: $kitVersion"
Write-Output "Using WindowsSdkDir: $windowsSdkDir"
"WINDOWS_TARGET_PLATFORM_VERSION=$kitVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"WINDOWS_SDK_DIR=$windowsSdkDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Quick VDD Compilation Check
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Write-Output "Performing quick VDD compilation check..."
$vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln"
if (-not (Test-Path $vddSln)) { throw "VDD solution file not found at: $vddSln" }
msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build
- name: Quick VAD Compilation Check
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Write-Output "Performing quick VAD compilation check..."
$vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln"
if (-not (Test-Path $vadSln)) { throw "VAD solution file not found at: $vadSln" }
msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build
- name: Checkout Virtual Driver Control Repository
uses: actions/checkout@v4
with:
repository: 'VirtualDrivers/Virtual-Driver-Control'
path: 'control-app-repo'
token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Control App Dependencies and Lint Check
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$controlAppPath = ""
if (Test-Path "control-app-repo/VirtualDriverControl/package.json") {
$controlAppPath = "control-app-repo/VirtualDriverControl"
Write-Output "Found control app in separate repository"
}
if ($controlAppPath -eq "") {
Write-Output "⚠️ Control App not found - skipping validation"
exit 0
}
Push-Location $controlAppPath
npm ci
$packageJson = Get-Content "package.json" | ConvertFrom-Json
if ($packageJson.scripts.lint) {
npm run lint
} else {
Write-Output "No lint script found, skipping lint check"
}
Pop-Location
- name: CI Validation Summary
if: always()
shell: pwsh
run: |
Write-Output "=== Fast CI Validation Summary ==="
Write-Output "Configuration: $env:BUILD_CONFIGURATION"
Write-Output "Event: ${{ github.event_name }}"
Write-Output "Branch: ${{ github.ref }}"
Write-Output "Commit: ${{ github.sha }}"