From d504c54cf595e9185617a3e611e417617be8c0b8 Mon Sep 17 00:00:00 2001 From: Adonais Romero González Date: Fri, 26 Aug 2022 14:48:11 -0700 Subject: Add CI workflows for building and validating driver samples (#775) * Add scripts to build a set of samples, as well as individual solution folders. * Add GitHub workflows to use these scripts and build all samples on push and changed samples on pull request. For now samples will be built under Windows 2019 but eventually workflow will be moved to run under Windows 2022. --- .github/scripts/Build-ChangedProjects.ps1 | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/scripts/Build-ChangedProjects.ps1 (limited to '.github/scripts') diff --git a/.github/scripts/Build-ChangedProjects.ps1 b/.github/scripts/Build-ChangedProjects.ps1 new file mode 100644 index 00000000..e163e5f9 --- /dev/null +++ b/.github/scripts/Build-ChangedProjects.ps1 @@ -0,0 +1,34 @@ +param ( + [array]$ChangedFiles +) + +$root = (Get-Location).Path + +# To include in CI gate +$projectSet = @{} +foreach ($file in $ChangedFiles) +{ + if (-not (Test-Path $file)) { + Write-Output "❔ Changed file $file cannot be found" + continue + } + $dir = (Get-Item $file).DirectoryName + while ((-not ($slnItems = (Get-ChildItem $dir '*.sln'))) -and ($dir -ne $root)) + { + $dir = (Get-Item $dir).Parent.FullName + } + if ($dir -eq $root) + { + Write-Output "❔ Changed file $file does not match a project." + continue + } + $projectName = $dir.Replace($root, '').Trim('\').Replace('\', '.').ToLower() + Write-Output "🔎 Found project [$projectName] at $dir from changed file $file" + if (-not ($projectSet.ContainsKey($projectName))) + { + $projectSet[$projectName] = $dir + } +} + +.\Build-ProjectSet -ProjectSet $projectSet + -- cgit v1.3.1