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. --- Build-ProjectSet.ps1 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Build-ProjectSet.ps1 (limited to 'Build-ProjectSet.ps1') diff --git a/Build-ProjectSet.ps1 b/Build-ProjectSet.ps1 new file mode 100644 index 00000000..57c4ac32 --- /dev/null +++ b/Build-ProjectSet.ps1 @@ -0,0 +1,38 @@ +param( + [hashtable]$ProjectSet, + [string]$Configuration = $env:Configuration, + [string]$Platform = $env:Platform +) + +#TODO validate params + +$exclusionsSet = @{} +$failSet = @() +Import-Csv 'exclusions.csv' | ForEach-Object { + $exclusionsSet[$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()] = $_.Reason +} + +$ProjectSet.GetEnumerator() | ForEach-Object { + $projectName = $_.Key + if ($exclusionsSet.ContainsKey($projectName)) + { + Write-Output "[$projectName] ⏩ Excluded and skipped. Reason: $($exclusionsSet[$projectName])" + return; + } + $directory = $_.Value + .\Build-Project -Directory $directory -ProjectName $ProjectName -Configuration $Configuration -Platform $Platform + if ($LASTEXITCODE -ne 0) + { + $failSet += $ProjectName + } +} + +if ($failSet.Count -gt 0) +{ + Write-Output "Some projects were built with errors:" + foreach ($failedProject in $failSet) + { + Write-Output "$failedProject" + } + Write-Error "Some projects were built with errors." +} \ No newline at end of file -- cgit v1.3.1