Skip to content

Commit 3dbe73d

Browse files
authored
Merge branch 'main' into fix-transaction-processing
2 parents d0b2ae2 + 57ecdd5 commit 3dbe73d

156 files changed

Lines changed: 1247 additions & 750 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
*.vcxproj text eol=crlf
2525
*.xaml text eol=crlf
2626

27+
# Declare files that are encoded in UTF-16
28+
*.inf text diff working-tree-encoding=UTF-16LE-BOM eol=crlf
29+
*.inx text diff working-tree-encoding=UTF-16LE-BOM eol=crlf
30+
2731
###############################################################################
2832
# Set default behavior for command prompt diff.
2933
#
@@ -32,4 +36,3 @@
3236
# Note: This is only used by command line
3337
###############################################################################
3438
*.cs diff=csharp
35-

.github/scripts/Build-ChangedSamples.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ foreach ($file in $ChangedFiles) {
2222
$filename = Split-Path $file -Leaf
2323

2424
# Files that can affect how every sample is built should trigger a full build
25-
if ($filename -eq "Build-AllSamples.ps1" -or $filename -eq "Build-Sample.ps1" -or $filename -eq "Build-SampleSet.ps1" -or $filename -eq "exclusions.csv") {
25+
if ($filename -eq "Build-AllSamples.ps1" -or $filename -eq "Build-Sample.ps1" -or $filename -eq "Build-SampleSet.ps1" -or $filename -eq "exclusions.csv" -or $filename -eq "Directory.Build.props" -or $filename -eq "packages.config") {
2626
$buildAll = $true
2727
}
2828
if ($dir -like "$root\.github\scripts" -or $dir -like "$root\.github\scripts\*") {

.github/workflows/Code-Scanning.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ on:
88
branches:
99
- main
1010
- develop
11+
paths-ignore:
12+
- '**.md'
13+
- 'LICENSE'
1114
pull_request:
1215
# The branches below must be a subset of the branches above
1316
branches:
1417
- main
1518
- develop
19+
paths-ignore:
20+
- '**.md'
21+
- 'LICENSE'
1622

1723
# Allow manual scheduling
1824
workflow_dispatch:
@@ -32,31 +38,27 @@ jobs:
3238
language: [ 'cpp' ]
3339

3440
steps:
35-
- name: Checkout repository
36-
uses: actions/checkout@v4
37-
with:
38-
submodules: 'recursive'
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: 'recursive'
45+
- name: Install Nuget Packages
46+
run: nuget restore .\packages.config -PackagesDirectory .\packages\
3947

40-
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v3
42-
with:
43-
languages: ${{ matrix.language }}
44-
packs: microsoft/windows-drivers
45-
- name: Add MSBuild to PATH
46-
uses: microsoft/setup-msbuild@v2
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v3
50+
with:
51+
languages: ${{ matrix.language }}
52+
config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development
53+
packs: +microsoft/windows-drivers@1.2.0-beta
54+
- name: Retrieve and build all available solutions
55+
run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1
56+
env:
57+
WDS_Configuration: Debug
58+
WDS_Platform: x64
59+
WDS_WipeOutputs: ${{ true }}
4760

48-
- name: Retrieve and build all available solutions
49-
run: |
50-
.\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1
51-
env:
52-
WDS_Configuration: Debug
53-
WDS_Platform: x64
54-
WDS_WipeOutputs: ${{ true }}
55-
56-
- name: Perform CodeQL analysis
57-
uses: github/codeql-action/analyze@v3
58-
with:
59-
category: "/language:${{matrix.language}}"
60-
61-
62-
61+
- name: Perform CodeQL analysis
62+
uses: github/codeql-action/analyze@v3
63+
with:
64+
category: "/language:${{matrix.language}}"

.github/workflows/ci-pr.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
with:
2323
submodules: 'recursive'
2424

25-
- name: Add MSBuild to PATH
26-
uses: microsoft/setup-msbuild@v2
25+
- name: Install Nuget Packages
26+
run: nuget restore .\packages.config -PackagesDirectory .\packages\
2727

2828
- name: Get changed files
2929
id: get-changed-files
@@ -41,10 +41,10 @@ jobs:
4141
WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }}
4242

4343
- name: Archive build logs and overview build reports
44-
uses: actions/upload-artifact@v3
44+
uses: actions/upload-artifact@v4
4545
if: always()
4646
with:
47-
name: logs
47+
name: logs-${{ matrix.configuration }}-${{ matrix.platform }}
4848
path: _logs
4949

5050
report:
@@ -57,17 +57,17 @@ jobs:
5757
uses: actions/checkout@v4
5858

5959
- name: Retrieve overview reports
60-
uses: actions/download-artifact@v3
60+
uses: actions/download-artifact@v4
6161
with:
62-
name: logs
6362
path: _logs
63+
pattern: logs-*
64+
merge-multiple: true
6465

6566
- name: Join and generate global reports
66-
run: |
67-
.\.github\scripts\Join-CsvReports.ps1
67+
run: .\.github\scripts\Join-CsvReports.ps1
6868

6969
- name: Archive global overview build reports
70-
uses: actions/upload-artifact@v3
70+
uses: actions/upload-artifact@v4
7171
with:
7272
name: logs
7373
path: _logs/_overview.all.*

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ jobs:
2222
with:
2323
submodules: 'recursive'
2424

25-
- name: Add MSBuild to PATH
26-
uses: microsoft/setup-msbuild@v2
25+
- name: Install Nuget Packages
26+
run: nuget restore .\packages.config -PackagesDirectory .\packages\
2727

2828
- name: Retrieve and build all available solutions
29-
run: |
30-
.\Build-AllSamples.ps1 -Verbose
29+
run: .\Build-AllSamples.ps1 -Verbose
3130
env:
3231
WDS_Configuration: ${{ matrix.configuration }}
3332
WDS_Platform: ${{ matrix.platform }}
3433
WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }}
3534

3635
- name: Archive build logs and overview build reports
37-
uses: actions/upload-artifact@v3
36+
uses: actions/upload-artifact@v4
3837
if: always()
3938
with:
40-
name: logs
39+
name: logs-${{ matrix.configuration }}-${{ matrix.platform }}
4140
path: _logs
4241

4342
report:
@@ -50,17 +49,17 @@ jobs:
5049
uses: actions/checkout@v4
5150

5251
- name: Retrieve overview reports
53-
uses: actions/download-artifact@v3
52+
uses: actions/download-artifact@v4
5453
with:
55-
name: logs
5654
path: _logs
55+
pattern: logs-*
56+
merge-multiple: true
5757

5858
- name: Join and generate global reports
59-
run: |
60-
.\.github\scripts\Join-CsvReports.ps1
59+
run: .\.github\scripts\Join-CsvReports.ps1
6160

6261
- name: Archive global overview build reports
63-
uses: actions/upload-artifact@v3
62+
uses: actions/upload-artifact@v4
6463
with:
6564
name: logs
6665
path: _logs/_overview.all.*

Build-SampleSet.ps1

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ param(
99
)
1010

1111
$root = Get-Location
12+
13+
# launch developer powershell (if necessary to prevent multiple developer sessions)
14+
if (-not $env:VSCMD_VER) {
15+
Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
16+
Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*")
17+
cd $root
18+
}
19+
1220
$ThrottleFactor = 5
1321
$LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors
1422

@@ -45,27 +53,31 @@ finally {
4553
}
4654

4755
#
48-
# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. Only used to determine build number.
56+
# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'.
4957
# Determine build number (used for exclusions based on build number). Five digits. Say, '22621'.
58+
# Determine NuGet package version (if applicable).
5059
#
5160
$build_environment=""
5261
$build_number=0
62+
$nuget_package_version=0
5363
#
54-
# WDK NuGet will require presence of a folder 'packages'
64+
# In Github we build using NuGet.
5565
#
56-
#
57-
# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded.
58-
#
59-
if (-not $env:GITHUB_REPOSITORY -eq '') {
66+
if ($env:GITHUB_REPOSITORY) {
6067
$build_environment="GitHub"
61-
$build_number=22621
68+
$nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value
69+
$build_number=$nuget_package_version.split('.')[2]
6270
}
6371
#
64-
# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages.
72+
# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1.
73+
#
74+
# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named '.\packages'.
75+
# Further, we need to test that the directory has been hydrated using '.\packages\*'.
6576
#
66-
elseif(Test-Path(".\packages")) {
77+
elseif(Test-Path(".\packages\*")) {
6778
$build_environment=("NuGet")
68-
$build_number=26100
79+
$nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value
80+
$build_number=$nuget_package_version.split('.')[2]
6981
}
7082
#
7183
# EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'.
@@ -91,7 +103,15 @@ else {
91103
Write-Error "Could not determine build environment."
92104
exit 1
93105
}
94-
106+
#
107+
# Get the WDK extension version from installed packages
108+
$wdk_extension_ver = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name
109+
$wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value
110+
if (-not $wdk_extension_ver) {
111+
Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed."
112+
exit 1
113+
}
114+
#
95115
#
96116
# InfVerif_AdditionalOptions
97117
#
@@ -153,18 +173,22 @@ $jresult = @{
153173

154174
$SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count
155175

156-
Write-Output ("Build Environment: " + $build_environment)
157-
Write-Output ("Build Number: " + $build_number)
158-
Write-Output ("Samples: " + $sampleSet.Count)
159-
Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")")
160-
Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")")
176+
Write-Output "WDK Build Environment: $build_environment"
177+
Write-Output "WDK Build Number: $build_number"
178+
if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) {
179+
Write-Output "WDK Nuget Version: $nuget_package_version"
180+
}
181+
Write-Output "WDK Extension Version: $wdk_extension_ver"
182+
Write-Output "Samples: $($sampleSet.Count)"
183+
Write-Output "Configurations: $($Configurations.Count) ($Configurations)"
184+
Write-Output "Platforms: $($Platforms.Count) ($Platforms)"
161185
Write-Output "InfVerif_AdditionalOptions: $InfVerif_AdditionalOptions"
162186
Write-Output "Combinations: $SolutionsTotal"
163187
Write-Output "LogicalProcessors: $LogicalProcessors"
164188
Write-Output "ThrottleFactor: $ThrottleFactor"
165189
Write-Output "ThrottleLimit: $ThrottleLimit"
166190
Write-Output "WDS_WipeOutputs: $env:WDS_WipeOutputs"
167-
Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB)))
191+
Write-Output "Disk Remaining (GB): $(((Get-Volume ((Get-Item ".").PSDrive.Name)).SizeRemaining) / 1GB)"
168192
Write-Output ""
169193
Write-Output "T: Combinations"
170194
Write-Output "B: Built"

0 commit comments

Comments
 (0)