summaryrefslogtreecommitdiff
path: root/.github/scripts
diff options
context:
space:
mode:
authorAdonais Romero González <[email protected]>2022-08-26 14:48:11 -0700
committerGitHub <[email protected]>2022-08-26 14:48:11 -0700
commitd504c54cf595e9185617a3e611e417617be8c0b8 (patch)
treef0d7d3e09abe2cf55ad646380488c8cde685f727 /.github/scripts
parent73c55fdc2e3d407ee39521ff4a1b2ea6791f134e (diff)
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.
Diffstat (limited to '.github/scripts')
-rw-r--r--.github/scripts/Build-ChangedProjects.ps134
1 files changed, 34 insertions, 0 deletions
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
+