diff options
| author | Adonais Romero González <[email protected]> | 2022-08-26 14:48:11 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-26 14:48:11 -0700 |
| commit | d504c54cf595e9185617a3e611e417617be8c0b8 (patch) | |
| tree | f0d7d3e09abe2cf55ad646380488c8cde685f727 /Build-ProjectSet.ps1 | |
| parent | 73c55fdc2e3d407ee39521ff4a1b2ea6791f134e (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 'Build-ProjectSet.ps1')
| -rw-r--r-- | Build-ProjectSet.ps1 | 38 |
1 files changed, 38 insertions, 0 deletions
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 |
