-
Notifications
You must be signed in to change notification settings - Fork 290
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
Merged
Merged
Changes from 26 commits
Commits
Show all changes
37 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 c4863a1
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 9f4065f
Apply suggestion from @Evangelink
Evangelink 612eeac
Remove RunnerVsVSTest.sln and update build-samples.ps1
Copilot db9879e
Updates and fixes
Evangelink f149a4d
Fix markdownlint issues
Evangelink a530a1b
Revert move
Evangelink 28a6152
Restore MSTestRunnerWinUI.sln that was removed by mistake
Copilot 2e1d87b
Enable TreatWarningsAsErrors for sample builds in CI
Copilot 2081d02
Update
Evangelink 7bd21f6
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 059bcc5
Fixes
Evangelink 9286043
More fixes
Evangelink fb95556
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 920ed7e
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 3cce9f0
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink be2a374
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink 8c85b1a
Fix issue
Evangelink 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
Youssef1313 marked this conversation as resolved.
Show resolved
Hide resolved
|
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,111 @@ | ||
| #!/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", | ||
| [switch]$TreatWarningsAsErrors | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| $repoRoot = Split-Path -Parent $PSScriptRoot | ||
| $samplesFolder = "$repoRoot/samples/public" | ||
|
|
||
| # Source the arcade tools to get access to InitializeDotNetCli | ||
| . "$PSScriptRoot/common/tools.ps1" | ||
|
|
||
| # Initialize .NET CLI to ensure correct SDK version is available | ||
| $dotnetRoot = InitializeDotNetCli -install:$true | ||
| $dotnetPath = "$dotnetRoot/dotnet.exe" | ||
|
|
||
| Write-Host "Building samples in: $samplesFolder" | ||
| Write-Host "Configuration: $Configuration" | ||
| 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)" | ||
|
|
||
| # UWP projects require MSBuild instead of dotnet build | ||
| $isUwpSolution = $solution.Name -eq "BlankUwpNet9App.sln" | ||
|
|
||
| if ($isUwpSolution) { | ||
| $msbuildPath = InitializeVisualStudioMSBuild -install:$true | ||
|
|
||
| $buildArgs = @( | ||
| $solution.FullName, | ||
| "/p:Configuration=$Configuration", | ||
| "/p:TreatWarningsAsErrors=$TreatWarningsAsErrors", | ||
| "/p:Platform=x64", | ||
| "/v:minimal" | ||
| ) | ||
|
|
||
| & $msbuildPath $buildArgs | ||
| } | ||
| else { | ||
| $buildArgs = @( | ||
| "build", | ||
| $solution.FullName, | ||
| "--configuration", $Configuration, | ||
| "/p:TreatWarningsAsErrors=$TreatWarningsAsErrors" | ||
| ) | ||
|
|
||
| & $dotnetPath $buildArgs | ||
| } | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "ERROR: Failed to build $($solution.Name)" | ||
| $failed = $true | ||
| $failureCount++ | ||
| } | ||
| else { | ||
| Write-Host "SUCCESS: Built $($solution.Name)" | ||
| $successCount++ | ||
| } | ||
|
|
||
| Write-Host "" | ||
| } | ||
|
|
||
| Write-Host "========================================" | ||
| Write-Host "Build Summary:" | ||
| Write-Host " Total solutions: $($solutions.Count)" | ||
| Write-Host " Succeeded: $successCount" | ||
| Write-Host " Failed: $failureCount" | ||
| Write-Host "========================================" | ||
|
|
||
| if ($failed) { | ||
| Write-Host "One or more samples failed to build" | ||
| exit 1 | ||
| } | ||
|
|
||
| Write-Host "All samples built successfully!" | ||
| 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
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
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
43 changes: 0 additions & 43 deletions
43
samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI.sln
Evangelink marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
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,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 |
Oops, something went wrong.
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.