From dcf6265102838bdd29899037a6fc630ae455f80d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:25:41 -0800 Subject: Bump tj-actions/changed-files from 35 to 41 in /.github/workflows (#1067) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35 to 41. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v35...v41) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 695d4186..fd2b78a6 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -27,7 +27,7 @@ jobs: - name: Get changed files id: get-changed-files - uses: tj-actions/changed-files@v35 + uses: tj-actions/changed-files@v41 with: separator: "," -- cgit v1.3.1 From cdd758d3b2427b8b8cc9c8a556f4400c7a4db45b Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:53:43 -0800 Subject: Update codeql code scanning to add microsoft/windows-drivers queries (#1098) * test code scanning with new package * update code scanning file. test without building * fix typo * add back build step * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml --- .github/workflows/Code-Scanning.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index fc1ae7e8..6915addf 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -38,10 +38,10 @@ jobs: submodules: 'recursive' - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - + packs: microsoft/windows-drivers - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.3.1 @@ -54,6 +54,9 @@ jobs: WDS_WipeOutputs: ${{ true }} - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + + + -- cgit v1.3.1 From bcc5c139181f66514b6767238f850f5b2d3aabd1 Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:30:57 -0800 Subject: Update jobs to use Node.js 20 (#1134) * Update Code-Scanning.yml actions/checkout to v4 and microsoft/setup-msbuild to v2 * Update ci-pr.yml to use node20 * Update ci.yml to use node20 --- .github/workflows/Code-Scanning.yml | 4 ++-- .github/workflows/ci-pr.yml | 6 +++--- .github/workflows/ci.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 6915addf..a18bcf95 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -43,7 +43,7 @@ jobs: languages: ${{ matrix.language }} packs: microsoft/windows-drivers - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.3.1 + uses: microsoft/setup-msbuild@v2 - name: Retrieve and build all available solutions run: | diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index fd2b78a6..7640b966 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -18,12 +18,12 @@ jobs: runs-on: windows-2022 steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.3.1 + uses: microsoft/setup-msbuild@v2 - name: Get changed files id: get-changed-files @@ -54,7 +54,7 @@ jobs: if: always() steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Retrieve overview reports uses: actions/download-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4fd1a2a..ad92f83b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,12 @@ jobs: runs-on: windows-2022 steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.3.1 + uses: microsoft/setup-msbuild@v2 - name: Retrieve and build all available solutions run: | @@ -47,7 +47,7 @@ jobs: if: always() steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Retrieve overview reports uses: actions/download-artifact@v3 -- cgit v1.3.1 From 263b19b4347fcda2e236c14a9daf41e7d518625d Mon Sep 17 00:00:00 2001 From: JakobL-MSFT <110699333+JakobL-MSFT@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:56:29 -0700 Subject: RI develop to main (#1189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Memory leakage in message "sizeof(SCANNER_MESSAGE) * threadCount * requestCount" bytes long memory is allocated but only "sizeof(SCANNER_MESSAGE) * threadCount" bytes long of it is freed. * Handles malloc function fail case * Refactors comment line * Solves the miscalculation of the message index * simbatt: Fix broken registry read-back The GetSimBattStateFromRegistry function is currently using default settings if GetSimBattStateFromRegistry succeeds, whereas settings from registry are only applied if GetSimBattStateFromRegistry fails. This does not make sense to me. Therefore proposing to remove the `!` negation from `if (!NT_SUCCESS(Status)) {` on the line after `Status = GetSimBattStateFromRegistry(Device, RegState);` so that default settings are loaded when registry read-back fails. * Issue of freeing memory without waiting completion of threads accessing it is fixed * Fixes information leakage warning Fixes the issue of possible information leakage from uninitialized padding bytes * Avoids possible multiplication overflow warning * Avoids possible multiplication overflow warning * CI Pipelines build with WDK Nuget Packages (#1179) Integrate nuget into the workflow pipelines * FI from main to develop (#1188) Fix text and minor issues in Winget configuration files Co-authored-by: Adonais Romero Gonzalez * Improve version info, vsix installation, and update building locally readme * Fix printing vsix version * Refactored vsix install and cleaned up build sampleset --------- Co-authored-by: İsa Yurdagül <38290414+isayrdgl@users.noreply.github.com> Co-authored-by: Fredrik Orderud Co-authored-by: Christian Allred <13487734+cgallred@users.noreply.github.com> Co-authored-by: tristanb-ntdev <60945150+tristanb-ntdev@users.noreply.github.com> Co-authored-by: Matt <138825652+middlemose@users.noreply.github.com> Co-authored-by: Adonais Romero Gonzalez --- .github/scripts/Install-Vsix.ps1 | 38 ++++++++++++++++++++ .github/workflows/Code-Scanning.yml | 56 +++++++++++++++--------------- .github/workflows/ci-pr.yml | 10 +++--- .github/workflows/ci.yml | 13 +++---- Build-SampleSet.ps1 | 51 +++++++++++++++++++++------ Building-Locally.md | 6 +++- filesys/miniFilter/scanner/user/scanUser.c | 52 +++++++++++++-------------- simbatt/func/miniclass.c | 2 +- 8 files changed, 151 insertions(+), 77 deletions(-) create mode 100644 .github/scripts/Install-Vsix.ps1 (limited to '.github/workflows') diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 new file mode 100644 index 00000000..50ef088b --- /dev/null +++ b/.github/scripts/Install-Vsix.ps1 @@ -0,0 +1,38 @@ +<# + +.SYNOPSIS +Download and install the latest WDK VSIX. + +#> + +# set uri by resolving amd64 vsix +$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" + +# set download version +$uri_version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value + +# set msbuild path +$msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") + +# download vsix, expand, and store the downloaded version extracted from the extension manifest +"Downloading WDK VSIX version: $uri_version..." +Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip +"Expanding WDK VSIX archive..." +Expand-Archive ".\wdk.zip" .\ +"Extracting version from manifest..." +$downloaded_version = ([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Downloaded WDK VSIX version: $downloaded_version" + +# copy msbuild files, extension manifest, and check installed version from the extension manifest +"Copying WDK extension files to build path..." +cp (".\`$MSBuild\*", ".\extension.vsixmanifest") "$msbuild_path" -Recurse -Force +"Extracting version from copied manifest..." +$installed_version = ([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version +"Installed WDK VSIX Version: $installed_version" +if (-not ("$downloaded_version" -eq "$installed_version")) { + "WDK VSIX installation failed due to version mismatch" + exit 1 +} + +# set github environment variable for vsix version +"SAMPLES_VSIX_VERSION=$installed_version" | Out-File -FilePath "$env:GITHUB_ENV" -Append diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index a18bcf95..cd0d8abf 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -32,31 +32,31 @@ jobs: language: [ 'cpp' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - packs: microsoft/windows-drivers - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 - env: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - - - + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + packs: microsoft/windows-drivers + + - name: Retrieve and build all available solutions + run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 7640b966..c04f4adb 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,8 +22,11 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Get changed files id: get-changed-files @@ -63,8 +66,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad92f83b..c35a81ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,14 @@ jobs: with: submodules: 'recursive' - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Install WDK VSIX + run: .\.github\scripts\Install-Vsix.ps1 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Retrieve and build all available solutions - run: | - .\Build-AllSamples.ps1 -Verbose + run: .\Build-AllSamples.ps1 -Verbose env: WDS_Configuration: ${{ matrix.configuration }} WDS_Platform: ${{ matrix.platform }} @@ -56,8 +58,7 @@ jobs: path: _logs - name: Join and generate global reports - run: | - .\.github\scripts\Join-CsvReports.ps1 + run: .\.github\scripts\Join-CsvReports.ps1 - name: Archive global overview build reports uses: actions/upload-artifact@v3 diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index b0da097a..adae8bb0 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -9,6 +9,14 @@ param( ) $root = Get-Location + +# launch developer powershell (if necessary to prevent multiple developer sessions) +if (-not $env:VSCMD_VER) { + Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") + Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") + cd $root +} + $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -45,27 +53,34 @@ finally { } # -# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. Only used to determine build number. +# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. +# Determine NuGet package version (if applicable). +# Determine WDK vsix version. # $build_environment="" $build_number=0 +$nuget_package_version=0 +$vsix_version="" # -# WDK NuGet will require presence of a folder 'packages' +# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. # -# -# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded. -# -if (-not $env:GITHUB_REPOSITORY -eq '') { +if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=22621 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] + $vsix_version = $env:SAMPLES_VSIX_VERSION } # -# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. +# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. +# +# Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named '.\packages'. +# Further, we need to test that the directory has been hydrated using '.\packages\*'. # -elseif(Test-Path(".\packages")) { +elseif(Test-Path(".\packages\*")) { $build_environment=("NuGet") - $build_number=26100 + $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value + $build_number=$nuget_package_version.split('.')[2] } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. @@ -91,7 +106,19 @@ else { Write-Error "Could not determine build environment." exit 1 } - +# +# Get the vsix version from packages if not set +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } +} +# # # InfVerif_AdditionalOptions # @@ -155,6 +182,8 @@ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } +Write-Output ("WDK VSIX Version: " + $vsix_version) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") diff --git a/Building-Locally.md b/Building-Locally.md index bb9fc610..e3db8dde 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -79,7 +79,11 @@ To build the Windows Driver Samples you need a "driver build environment". In e ### Option A: Use WDK NuGet Packages * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK. -* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). Open Visual Studio -> Extensions -> Manage Extensions... -> Online -> Visual Studio Market Place -> Windows Driver Kit -> 10.0.26100.0 -> Download +* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). + * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse. + * In the search bar type: `Windows Driver Kit`. + * Find the `Microsoft` signed extension. + * Click the Install button. * Launch a "Developer Command Prompt for VS 2022". * Restore WDK packages from feed : diff --git a/filesys/miniFilter/scanner/user/scanUser.c b/filesys/miniFilter/scanner/user/scanUser.c index e766261c..08b948b3 100644 --- a/filesys/miniFilter/scanner/user/scanUser.c +++ b/filesys/miniFilter/scanner/user/scanUser.c @@ -254,8 +254,6 @@ Return Value } } - free( message ); - return hr; } @@ -268,13 +266,12 @@ main ( { DWORD requestCount = SCANNER_DEFAULT_REQUEST_COUNT; DWORD threadCount = SCANNER_DEFAULT_THREAD_COUNT; - HANDLE threads[SCANNER_MAX_THREAD_COUNT]; + HANDLE threads[SCANNER_MAX_THREAD_COUNT] = { NULL }; SCANNER_THREAD_CONTEXT context; HANDLE port, completion; - PSCANNER_MESSAGE msg; + PSCANNER_MESSAGE messages; DWORD threadId; HRESULT hr; - DWORD i, j; // // Check how many threads and per thread requests are desired. @@ -343,11 +340,23 @@ main ( context.Completion = completion; // - // Create specified number of threads. + // Allocate messages. // - for (i = 0; i < threadCount; i++) { + messages = calloc(((size_t) threadCount) * requestCount, sizeof(SCANNER_MESSAGE)); + + if (messages == NULL) { + hr = ERROR_NOT_ENOUGH_MEMORY; + goto main_cleanup; + } + + // + // Create specified number of threads. + // + + for (DWORD i = 0; i < threadCount; i++) { + threads[i] = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) ScannerWorker, @@ -366,20 +375,9 @@ main ( goto main_cleanup; } - for (j = 0; j < requestCount; j++) { - - // - // Allocate the message. - // - -#pragma prefast(suppress:__WARNING_MEMORY_LEAK, "msg will not be leaked because it is freed in ScannerWorker") - msg = malloc( sizeof( SCANNER_MESSAGE ) ); - - if (msg == NULL) { - - hr = ERROR_NOT_ENOUGH_MEMORY; - goto main_cleanup; - } + for (DWORD j = 0; j < requestCount; j++) { + + PSCANNER_MESSAGE msg = &(messages[i * requestCount + j]); memset( &msg->Ovlp, 0, sizeof( OVERLAPPED ) ); @@ -393,24 +391,26 @@ main ( &msg->Ovlp ); if (hr != HRESULT_FROM_WIN32( ERROR_IO_PENDING )) { - - free( msg ); goto main_cleanup; } } } hr = S_OK; - - WaitForMultipleObjectsEx( i, threads, TRUE, INFINITE, FALSE ); - + main_cleanup: + for (INT i = 0; threads[i] != NULL; ++i) { + WaitForSingleObjectEx(threads[i], INFINITE, FALSE); + } + printf( "Scanner: All done. Result = 0x%08x\n", hr ); CloseHandle( port ); CloseHandle( completion ); + free(messages); + return hr; } diff --git a/simbatt/func/miniclass.c b/simbatt/func/miniclass.c index ba2df340..612b4c66 100644 --- a/simbatt/func/miniclass.c +++ b/simbatt/func/miniclass.c @@ -202,7 +202,7 @@ Return Value: } Status = GetSimBattStateFromRegistry(Device, RegState); - if (!NT_SUCCESS(Status)) { + if (NT_SUCCESS(Status)) { RtlZeroMemory(RegState, sizeof(SIMBATT_STATE)); WdfWaitLockAcquire(DevExt->StateLock, NULL); -- cgit v1.3.1 From 5c4ceaef72f0af992966a7d2ac7ac7d897f091d3 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:43:48 -0700 Subject: Deprecate WDK VSIX Install (#1219) * Deprecate WDK vsix install * Fix WDK extension version print * Remove unecessary splitting on version * Minor build info refactor * Fix indentation of output info * Enough messing with volume size output * Cleanup comment for vsix version * More cleanup and doc update * Remove deprecation statement and install vsix script. * Fixes and updates to building locally documentation. * Dont code scan on license or .md files. * Code scanning ignore changes to .md when pull request is made --- .github/scripts/Install-Vsix.ps1 | 38 -------------------- .github/workflows/Code-Scanning.yml | 9 +++-- .github/workflows/ci-pr.yml | 3 -- .github/workflows/ci.yml | 3 -- Build-SampleSet.ps1 | 39 +++++++++------------ Building-Locally.md | 70 +++++++++++++++++++++++-------------- configuration.dsc.yaml | 19 ++-------- configuration_vsonly.dsc.yaml | 3 +- 8 files changed, 71 insertions(+), 113 deletions(-) delete mode 100644 .github/scripts/Install-Vsix.ps1 (limited to '.github/workflows') diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 deleted file mode 100644 index 50ef088b..00000000 --- a/.github/scripts/Install-Vsix.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -<# - -.SYNOPSIS -Download and install the latest WDK VSIX. - -#> - -# set uri by resolving amd64 vsix -$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)" - -# set download version -$uri_version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value - -# set msbuild path -$msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") - -# download vsix, expand, and store the downloaded version extracted from the extension manifest -"Downloading WDK VSIX version: $uri_version..." -Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip -"Expanding WDK VSIX archive..." -Expand-Archive ".\wdk.zip" .\ -"Extracting version from manifest..." -$downloaded_version = ([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version -"Downloaded WDK VSIX version: $downloaded_version" - -# copy msbuild files, extension manifest, and check installed version from the extension manifest -"Copying WDK extension files to build path..." -cp (".\`$MSBuild\*", ".\extension.vsixmanifest") "$msbuild_path" -Recurse -Force -"Extracting version from copied manifest..." -$installed_version = ([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version -"Installed WDK VSIX Version: $installed_version" -if (-not ("$downloaded_version" -eq "$installed_version")) { - "WDK VSIX installation failed due to version mismatch" - exit 1 -} - -# set github environment variable for vsix version -"SAMPLES_VSIX_VERSION=$installed_version" | Out-File -FilePath "$env:GITHUB_ENV" -Append diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index cd0d8abf..16aaff39 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -8,11 +8,17 @@ on: branches: - main - develop + paths-ignore: + - '**.md' + - 'LICENSE' pull_request: # The branches below must be a subset of the branches above branches: - main - develop + paths-ignore: + - '**.md' + - 'LICENSE' # Allow manual scheduling workflow_dispatch: @@ -37,9 +43,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index c04f4adb..72fb176f 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c35a81ec..11dee203 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index adae8bb0..f6765395 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -56,20 +56,17 @@ finally { # Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'. # Determine build number (used for exclusions based on build number). Five digits. Say, '22621'. # Determine NuGet package version (if applicable). -# Determine WDK vsix version. # $build_environment="" $build_number=0 $nuget_package_version=0 -$vsix_version="" # -# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. +# In Github we build using NuGet. # if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value $build_number=$nuget_package_version.split('.')[2] - $vsix_version = $env:SAMPLES_VSIX_VERSION } # # WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. @@ -107,16 +104,12 @@ else { exit 1 } # -# Get the vsix version from packages if not set -if (-not $vsix_version) { - $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name - if ($vsix_version) { - $vsix_version = $vsix_version.split('=')[1] - } - else { - Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." - exit 1 - } +# Get the WDK extension version from installed packages +$wdk_extension_ver = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name +$wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value +if (-not $wdk_extension_ver) { + Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." + exit 1 } # # @@ -180,20 +173,22 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count -Write-Output ("Build Environment: " + $build_environment) -Write-Output ("Build Number: " + $build_number) -if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } -Write-Output ("WDK VSIX Version: " + $vsix_version) -Write-Output ("Samples: " + $sampleSet.Count) -Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") -Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") +Write-Output "WDK Build Environment: $build_environment" +Write-Output "WDK Build Number: $build_number" +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { +Write-Output "WDK Nuget Version: $nuget_package_version" +} +Write-Output "WDK Extension Version: $wdk_extension_ver" +Write-Output "Samples: $($sampleSet.Count)" +Write-Output "Configurations: $($Configurations.Count) ($Configurations)" +Write-Output "Platforms: $($Platforms.Count) ($Platforms)" Write-Output "InfVerif_AdditionalOptions: $InfVerif_AdditionalOptions" Write-Output "Combinations: $SolutionsTotal" Write-Output "LogicalProcessors: $LogicalProcessors" Write-Output "ThrottleFactor: $ThrottleFactor" Write-Output "ThrottleLimit: $ThrottleLimit" Write-Output "WDS_WipeOutputs: $env:WDS_WipeOutputs" -Write-Output ("Disk Remaining (GB): " + (((Get-Volume ($DriveLetter = (Get-Item ".").PSDrive.Name)).SizeRemaining / 1GB))) +Write-Output "Disk Remaining (GB): $(((Get-Volume ((Get-Item ".").PSDrive.Name)).SizeRemaining) / 1GB)" Write-Output "" Write-Output "T: Combinations" Write-Output "B: Built" diff --git a/Building-Locally.md b/Building-Locally.md index e3db8dde..312c5967 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -2,16 +2,19 @@ ## Step 1: Install Tools -``` +```powershell winget install --id Microsoft.Powershell --source winget winget install --id Git.Git --source winget ``` For using WDK NuGet feed based build additionally: -``` + +```powershell winget install --id Microsoft.NuGet --source winget ``` +--- + ## Step 2: Optional: Disable Strong Name Validation When: This step is only required if you will be using pre-release versions of the WDK. @@ -26,16 +29,20 @@ reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,31bf3856 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,31bf3856ad364e35 /v TestPublicKey /t REG_SZ /d 00240000048000009400000006020000002400005253413100040000010001003f8c902c8fe7ac83af7401b14c1bd103973b26dfafb2b77eda478a2539b979b56ce47f36336741b4ec52bbc51fecd51ba23810cec47070f3e29a2261a2d1d08e4b2b4b457beaa91460055f78cc89f21cd028377af0cc5e6c04699b6856a1e49d5fad3ef16d3c3d6010f40df0a7d6cc2ee11744b5cfb42e0f19a52b8a29dc31b0 /f ``` +--- + ## Step 3: Optional: Install Microsoft .NET Framework 4.7.2 Targeting Pack and Microsoft .NET Framework 4.8.1 SDK When: This step is only required to build sample usb\usbview . ### Option A: Install VS Components + Easy: If you will install Visual Studio (see later) you may at that point select to add both of following individual components: * .NET Framework 4.7.2 targeting pack * .NET Framework 4.8.1 SDK ### Option B: Use EWDK + Easy: If you use EWDK, then all necessary prequisites are included. ### Option C: Install Developer Pack @@ -52,24 +59,30 @@ This will install following Apps: * Microsoft .NET Framework 4.8.1 Targeting Pack * Microsoft .NET Framework 4.8.1 Targeting Pack (ENU) +--- + ## Step 4: Clone Windows Driver Samples and checkout relevant branch -``` -cd path\to\your\repos -git clone --recurse-submodules https://github.com/microsoft/Windows-driver-samples.git -cd Windows-driver-samples +```powershell +cd "path\to\your\repos" +git clone --recurse-submodules "https://github.com/microsoft/Windows-driver-samples.git" +cd ".\Windows-driver-samples" ``` If you are planning to use in-market WDK, then you would typically want to use the 'main' branch: + ``` git checkout main ``` If you are planning to use a WDK Preview or WDK EEAP release, then you would typically want to use the 'develop' branch: + ``` git checkout develop ``` +--- + ## Step 5: Create a "driver build environment" To build the Windows Driver Samples you need a "driver build environment". In essence an environment that consist of following prerequisites: @@ -78,53 +91,55 @@ To build the Windows Driver Samples you need a "driver build environment". In e * The Windows Driver Kit. ### Option A: Use WDK NuGet Packages -* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete "Step 1". You do not need to install the SDK or the WDK. -* Install the Visual Studio Windows Driver Kit Extension (WDK.vsix). - * Open Visual Studio -> Extensions -> Manage Extensions... -> Browse. - * In the search bar type: `Windows Driver Kit`. - * Find the `Microsoft` signed extension. - * Click the Install button. + +* See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, but only complete `Step 1`. You do not need to install the SDK or the WDK. * Launch a "Developer Command Prompt for VS 2022". * Restore WDK packages from feed : -``` ->cd path\to\your\repos\Windows-driver-samples ->nuget restore -PackagesDirectory .\packages +```powershell +cd "path\to\your\repos\Windows-driver-samples" +nuget restore -PackagesDirectory ".\packages" ``` -* When this is done you should have a .\packages folder that looks exactly as follows: -``` ->cd path\to\your\repos\Windows-driver-samples ->dir /b packages +* When this is done you should have a .\packages folder that looks like example below: + +```powershell +cd "path\to\your\repos\Windows-driver-samples" +dir /b packages Microsoft.Windows.SDK.CPP.10.0.26000.1 Microsoft.Windows.SDK.CPP.x64.10.0.26000.1 Microsoft.Windows.SDK.CPP.arm64.10.0.26000.1 Microsoft.Windows.WDK.x64.10.0.26000.1 Microsoft.Windows.WDK.arm64.10.0.26000.1 ``` + ### Option B: Use the Windows Driver Kit + * Here you will install each of above prerequisites one at a time. * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to install Visual Studio, SDK, and WDK. * Launch a "Developer Command Prompt for VS 2022". ### Option C: Use an Enterprise WDK + * You can also simply use the Enterprise WDK (EWDK), a standalone, self-contained command-line environment for building drivers that contains all prerequisites in one combined ISO. * See [Download the Windows Driver Kit (WDK)](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for instructions on how to download the EWDK. * Mount ISO image * Open a terminal * `.\LaunchBuildEnv` +--- ## Step 6: Check all samples builds with expected results for all flavors -``` +```powershell pwsh .\Build-AllSamples ``` Above builds all samples for all configurations and platforms. You can refine what exact samples to build, what configurations, and platforms to build. build Here are a few examples: -``` + +```powershell # Get Help: Get-Help .\Build-AllSamples @@ -144,9 +159,9 @@ Get-Help .\Build-AllSamples .\Build-AllSamples -Samples '^tools.' -Configurations 'Debug' -Platforms 'x64' ``` -Expected output: +Example of expected output: + ``` -PS > .\build-AllSamples.ps1 Build Environment: NuGet Build Number: 26100 Samples: 132 @@ -190,6 +205,8 @@ Log files directory: .\_logs Overview report: .\_overview.htm ``` +--- + ## 7: NuGet - Additional Notes To restore a specific version of our WDK NuGet packages: @@ -201,12 +218,13 @@ Follow these steps before running "nuget restore" command: * Now you can run "nuget restore" A few examples of how to interact with nuget: -``` + +```powershell # To add an alternative online NuGet source: -nuget sources add -Name "MyNuGetFeed" -Source https://nugetserver.com/_packaging/feedname/nuget/v3/index.json +nuget sources add -Name "MyNuGetFeed" -Source "https://nugetserver.com/_packaging/feedname/nuget/v3/index.json" # To add an alternative local NuGet source: -nuget sources add -Name "MyNuGetFeed" -Source \\path\to\mylocalrepo +nuget sources add -Name "MyNuGetFeed" -Source "\\path\to\mylocalrepo" # To remove an alternative NuGet source: nuget sources remove -Name "MyNuGetFeed" diff --git a/configuration.dsc.yaml b/configuration.dsc.yaml index f8245c08..3d25ff06 100644 --- a/configuration.dsc.yaml +++ b/configuration.dsc.yaml @@ -42,6 +42,7 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop + - Component.Microsoft.Windows.DriverKit - resource: Microsoft.WinGet.DSC/WinGetPackage id: sdkPackage directives: @@ -62,20 +63,4 @@ properties: id: Microsoft.WindowsWDK.10.0.26100 source: winget useLatest: true - - resource: PSDscResources/Script - id: wdkVsix - dependsOn: - - wdkPackage - - vsComponents - directives: - description: Install Windows Driver Kit VSIX - settings: - GetScript: | - return & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - SetScript: | - $installerPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe' - if (Test-Path $installerPath) { & $installerPath /q "${env:ProgramFiles(x86)}\Windows Kits\10\Vsix\VS2022\10.0.26100.0\${env:PROCESSOR_ARCHITECTURE}\WDK.vsix" } - TestScript: | - $versionString = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - return $versionString -match "^17\." - configurationVersion: 0.2.0 + configurationVersion: 0.2.1 diff --git a/configuration_vsonly.dsc.yaml b/configuration_vsonly.dsc.yaml index 6ce4fc83..9d86a4f7 100644 --- a/configuration_vsonly.dsc.yaml +++ b/configuration_vsonly.dsc.yaml @@ -42,4 +42,5 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop - configurationVersion: 0.2.0 + - Component.Microsoft.Windows.DriverKit + configurationVersion: 0.2.1 -- cgit v1.3.1 From 616b1914cf05f0aea9c40b10009bd7be0354c28b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:45:18 -0700 Subject: Bump actions/download-artifact & actions/upload-artifact from 3 to 4 in /.github/workflows (#1211) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adonais Romero Gonzalez --- .github/workflows/ci-pr.yml | 11 ++++++----- .github/workflows/ci.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 72fb176f..9c1202b2 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -41,10 +41,10 @@ jobs: WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: logs + name: logs-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: @@ -57,16 +57,17 @@ jobs: uses: actions/checkout@v4 - name: Retrieve overview reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: logs 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@v3 + uses: actions/upload-artifact@v4 with: name: logs path: _logs/_overview.all.* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11dee203..e43d74f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,10 +33,10 @@ jobs: WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: logs + name: logs-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: @@ -49,16 +49,17 @@ jobs: uses: actions/checkout@v4 - name: Retrieve overview reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: logs 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@v3 + uses: actions/upload-artifact@v4 with: name: logs path: _logs/_overview.all.* -- cgit v1.3.1 From 76f3c4f35f40634401ede80f64554794776c4240 Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:35:52 -0700 Subject: Code scanning updates (#1) (#1221) * Update Code-Scanning.yml --- .github/workflows/Code-Scanning.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 16aaff39..72e9c32c 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -42,7 +42,6 @@ jobs: uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ @@ -50,8 +49,8 @@ jobs: uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - packs: microsoft/windows-drivers - + config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development + packs: +microsoft/windows-drivers@1.2.0-beta - name: Retrieve and build all available solutions run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 env: -- cgit v1.3.1 From fb21b13a73457c8a68a7aca41d80e7f292929d1f Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Wed, 19 Mar 2025 13:56:21 -0700 Subject: update workflow files to split codeql analysis for push and PR (#1273) * update workflow files to split codeql analysis for push and PR * test changing a file * remove build all option in script for testing. * Revert "remove build all option in script for testing." This reverts commit 04eb2c34aac69545b56ff86b6d642e453bde89f0. * Revert "test changing a file" This reverts commit d69205126f62ad44af4c5e3b64f1f14637116ea2. * combine pr and push analysis files to remove warning about not having on.push trigger. include script changes and file change for testing * remove test changes --- .github/workflows/Code-Scanning.yml | 48 +++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 72e9c32c..e843271f 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -24,8 +24,9 @@ on: workflow_dispatch: jobs: - analyze: - name: Analysis + analyze-push: + name: Analysis-Push + if: github.event_name == 'push' runs-on: windows-latest permissions: actions: read @@ -62,3 +63,46 @@ jobs: uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + analyze-pr: + name: Analysis-PR + if: github.event_name == 'pull_request' + runs-on: windows-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: manual + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + - name: Get changed files + id: get-changed-files + uses: tj-actions/changed-files@v41 + with: + separator: "," + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development + packs: +microsoft/windows-drivers@1.2.0-beta + - if: matrix.build-mode == 'manual' + run: | + $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',') + .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" \ No newline at end of file -- cgit v1.3.1 From 61fe2ecffeeb6a77c9352384bee6f63812b0a697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 20:29:47 +0000 Subject: Bump tj-actions/changed-files from 41 to 46 in /.github/workflows Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 41 to 46. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v41...v46) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- .github/workflows/ci-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 9c1202b2..0e5825d1 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -27,7 +27,7 @@ jobs: - name: Get changed files id: get-changed-files - uses: tj-actions/changed-files@v41 + uses: tj-actions/changed-files@v46 with: separator: "," -- cgit v1.3.1 From 52908d7718c6fac2953055db2e5d23537957c7af Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:59:45 -0700 Subject: Update Code-Scanning.yml to use latest windows-drivers pack (#1277) * Update Code-Scanning.yml to use latest windows-drivers pack * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml: reduce duplacate code --- .github/workflows/Code-Scanning.yml | 59 +++++++++---------------------------- 1 file changed, 14 insertions(+), 45 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index e843271f..63e155c9 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -24,48 +24,8 @@ on: workflow_dispatch: jobs: - analyze-push: - name: Analysis-Push - if: github.event_name == 'push' - runs-on: windows-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - name: Install Nuget Packages - run: nuget restore .\packages.config -PackagesDirectory .\packages\ - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development - packs: +microsoft/windows-drivers@1.2.0-beta - - name: Retrieve and build all available solutions - run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 - env: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - analyze-pr: - name: Analysis-PR - if: github.event_name == 'pull_request' + analyze: + name: Analysis runs-on: windows-latest permissions: actions: read @@ -97,12 +57,21 @@ jobs: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development - packs: +microsoft/windows-drivers@1.2.0-beta - - if: matrix.build-mode == 'manual' + - if: github.event_name == 'pull_request' run: | $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',') .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + - if: github.event_name == 'push' + run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v3 with: - category: "/language:${{matrix.language}}" \ No newline at end of file + category: "/language:${{matrix.language}}" -- cgit v1.3.1 From 32638ee67f3283680aea33667989b5e7e51a83b7 Mon Sep 17 00:00:00 2001 From: v-junyli Date: Mon, 14 Jul 2025 05:26:00 -0700 Subject: adding a schedule to build-all-samples workflow --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e43d74f5..ed0402f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: paths-ignore: - '**.md' - 'LICENSE' + schedule: + # Runs every Tuesday at 00:00 PST (08:00 UTC) + - cron: '0 8 * * 2' jobs: build: name: Build driver samples -- cgit v1.3.1 From 08b0944581a8038ba690ceda4584272dd547d2d4 Mon Sep 17 00:00:00 2001 From: v-junyli Date: Fri, 25 Jul 2025 20:09:39 -0700 Subject: fixing the schedule --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed0402f2..e0992478 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,9 @@ on: paths-ignore: - '**.md' - 'LICENSE' - schedule: - # Runs every Tuesday at 00:00 PST (08:00 UTC) - - cron: '0 8 * * 2' + schedule: + # Runs every Saturday at 00:00 PST (08:00 UTC) + - cron: '0 8 * * 0' jobs: build: name: Build driver samples -- cgit v1.3.1 From a5566f00aefe1ac770a96b299fa62d1a6e3da831 Mon Sep 17 00:00:00 2001 From: v-junyli Date: Fri, 25 Jul 2025 20:34:57 -0700 Subject: fixing schedule --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0992478..1f3d7693 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: - 'LICENSE' schedule: # Runs every Saturday at 00:00 PST (08:00 UTC) - - cron: '0 8 * * 0' + - cron: '0 8 * * 6' jobs: build: name: Build driver samples -- cgit v1.3.1