-
Notifications
You must be signed in to change notification settings - Fork 288
Add samples build verification to CI pipeline #6802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
20
commits into
main
Choose a base branch
from
copilot/fix-ci-build-for-samples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+215
−0
Open
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0aa7d2b
Initial plan
Copilot 471a1a0
Add Windows Release build job for samples in CI pipeline
Copilot 004a209
Improve sample build script to properly fail on build errors
Copilot 3efffd2
Fix batch script variable comparison syntax
Copilot 9203554
Address review feedback: remove BuildMainProducts, add solution files…
Copilot b90bc20
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 12b1490
Remove colored output from build-samples.ps1 to fix pipeline YAML par…
Copilot b13f450
Apply suggestion from @Evangelink
Evangelink 5e8bf58
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 9ecbb0a
Apply suggestion from @Evangelink
Evangelink 8ce6ef5
Uncomment Samples_Windows job in pipeline
Evangelink bf22e18
Clean up azure-pipelines.yml by removing unused tasks
Evangelink 57779c1
Update azure-pipelines.yml
Evangelink 745df4f
Rename job and increase timeout for WindowsSamples
Evangelink 569991b
Update azure-pipelines.yml
Evangelink 4cd6c2c
Fix Join-Path usage for PowerShell 5.1 compatibility
Copilot ab78477
Try to fix dotnet
Evangelink b173ac8
Fix
Evangelink 630240e
Address review comments: simplify path handling and use switch parameter
Copilot d3461a9
Exclude RunnerVsVSTest.sln from CI build (too slow)
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #!/usr/bin/env pwsh | ||
| <# | ||
| .SYNOPSIS | ||
| Builds all sample projects in the samples/public folder. | ||
|
|
||
| .DESCRIPTION | ||
| This script iterates through all solution files in samples/public and builds them. | ||
| It can be used both locally by developers and in CI pipelines. | ||
|
|
||
| .PARAMETER Configuration | ||
| The build configuration to use (default: Release). | ||
|
|
||
| .PARAMETER TreatWarningsAsErrors | ||
| Whether to treat warnings as errors (default: false). | ||
|
|
||
| .EXAMPLE | ||
| .\eng\build-samples.ps1 | ||
| Builds all samples in Release configuration. | ||
|
|
||
| .EXAMPLE | ||
| .\eng\build-samples.ps1 -Configuration Debug | ||
| Builds all samples in Debug configuration. | ||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
| [string]$Configuration = "Release", | ||
| [bool]$TreatWarningsAsErrors = $false | ||
Evangelink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| $repoRoot = Split-Path -Parent $PSScriptRoot | ||
| $samplesFolder = Join-Path $repoRoot "samples" "public" | ||
|
|
||
| Write-Host "Building samples in: $samplesFolder" -ForegroundColor Cyan | ||
| Write-Host "Configuration: $Configuration" -ForegroundColor Cyan | ||
| Write-Host "" | ||
|
|
||
| $failed = $false | ||
| $successCount = 0 | ||
| $failureCount = 0 | ||
|
|
||
| # Find all solution files in samples/public | ||
| $solutions = Get-ChildItem -Path $samplesFolder -Filter "*.sln" -Recurse | ||
|
|
||
| foreach ($solution in $solutions) { | ||
| Write-Host "Building solution: $($solution.FullName)" -ForegroundColor Yellow | ||
|
|
||
| $buildArgs = @( | ||
| "build", | ||
| $solution.FullName, | ||
| "--configuration", $Configuration, | ||
| "/p:TreatWarningsAsErrors=$TreatWarningsAsErrors" | ||
| ) | ||
|
|
||
| & dotnet $buildArgs | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "ERROR: Failed to build $($solution.Name)" -ForegroundColor Red | ||
| $failed = $true | ||
| $failureCount++ | ||
| } | ||
| else { | ||
| Write-Host "SUCCESS: Built $($solution.Name)" -ForegroundColor Green | ||
| $successCount++ | ||
| } | ||
|
|
||
| Write-Host "" | ||
| } | ||
|
|
||
| Write-Host "========================================" -ForegroundColor Cyan | ||
| Write-Host "Build Summary:" -ForegroundColor Cyan | ||
| Write-Host " Total solutions: $($solutions.Count)" -ForegroundColor Cyan | ||
| Write-Host " Succeeded: $successCount" -ForegroundColor Green | ||
| Write-Host " Failed: $failureCount" -ForegroundColor Red | ||
| Write-Host "========================================" -ForegroundColor Cyan | ||
|
|
||
| if ($failed) { | ||
| Write-Host "One or more samples failed to build" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| Write-Host "All samples built successfully!" -ForegroundColor Green | ||
| exit 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.0.31903.59 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple1", "Simple1.csproj", "{2AE4FD73-ECFB-4AB0-A02D-A1863750C012}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {2AE4FD73-ECFB-4AB0-A02D-A1863750C012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {2AE4FD73-ECFB-4AB0-A02D-A1863750C012}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {2AE4FD73-ECFB-4AB0-A02D-A1863750C012}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {2AE4FD73-ECFB-4AB0-A02D-A1863750C012}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| EndGlobal |
69 changes: 69 additions & 0 deletions
69
samples/public/mstest-runner/runner_vs_vstest/RunnerVsVSTest.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.0.31903.59 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10C_100M", "10C_100M", "{409754A0-EACE-40B2-6272-539A6337F573}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10C100M", "10C_100M\10C100M.csproj", "{53174F83-E486-480A-A8C5-2C281A3E8215}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "100C100M", "100C_100M\100C100M.csproj", "{C6DEC71F-D6AB-4D01-9800-E375F0D58C07}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "1000C100M", "1000C_100M\1000C100M.csproj", "{A73ABB71-CDBC-4789-AAEA-629B8A9BA514}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Debug|x64 = Debug|x64 | ||
| Debug|x86 = Debug|x86 | ||
| Release|Any CPU = Release|Any CPU | ||
| Release|x64 = Release|x64 | ||
| Release|x86 = Release|x86 | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|x64.Build.0 = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Debug|x86.Build.0 = Debug|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|x64.ActiveCfg = Release|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|x64.Build.0 = Release|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|x86.ActiveCfg = Release|Any CPU | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215}.Release|x86.Build.0 = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|x64.Build.0 = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Debug|x86.Build.0 = Debug|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|x64.ActiveCfg = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|x64.Build.0 = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|x86.ActiveCfg = Release|Any CPU | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07}.Release|x86.Build.0 = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|x64.Build.0 = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Debug|x86.Build.0 = Debug|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|x64.ActiveCfg = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|x64.Build.0 = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|x86.ActiveCfg = Release|Any CPU | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514}.Release|x86.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(NestedProjects) = preSolution | ||
| {53174F83-E486-480A-A8C5-2C281A3E8215} = {409754A0-EACE-40B2-6272-539A6337F573} | ||
| {C6DEC71F-D6AB-4D01-9800-E375F0D58C07} = {409754A0-EACE-40B2-6272-539A6337F573} | ||
| {A73ABB71-CDBC-4789-AAEA-629B8A9BA514} = {409754A0-EACE-40B2-6272-539A6337F573} | ||
| EndGlobalSection | ||
| EndGlobal |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.