Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0aa7d2b
Initial plan
Copilot Oct 26, 2025
471a1a0
Add Windows Release build job for samples in CI pipeline
Copilot Oct 26, 2025
004a209
Improve sample build script to properly fail on build errors
Copilot Oct 26, 2025
3efffd2
Fix batch script variable comparison syntax
Copilot Oct 26, 2025
9203554
Address review feedback: remove BuildMainProducts, add solution files…
Copilot Oct 26, 2025
b90bc20
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink Oct 29, 2025
12b1490
Remove colored output from build-samples.ps1 to fix pipeline YAML par…
Copilot Oct 29, 2025
b13f450
Apply suggestion from @Evangelink
Evangelink Oct 29, 2025
5e8bf58
Merge branch 'main' into copilot/fix-ci-build-for-samples
Evangelink Oct 29, 2025
9ecbb0a
Apply suggestion from @Evangelink
Evangelink Oct 29, 2025
8ce6ef5
Uncomment Samples_Windows job in pipeline
Evangelink Oct 29, 2025
bf22e18
Clean up azure-pipelines.yml by removing unused tasks
Evangelink Oct 29, 2025
57779c1
Update azure-pipelines.yml
Evangelink Oct 29, 2025
745df4f
Rename job and increase timeout for WindowsSamples
Evangelink Oct 29, 2025
569991b
Update azure-pipelines.yml
Evangelink Oct 29, 2025
4cd6c2c
Fix Join-Path usage for PowerShell 5.1 compatibility
Copilot Oct 29, 2025
ab78477
Try to fix dotnet
Evangelink Oct 29, 2025
b173ac8
Fix
Evangelink Oct 29, 2025
630240e
Address review comments: simplify path handling and use switch parameter
Copilot Oct 30, 2025
d3461a9
Exclude RunnerVsVSTest.sln from CI build (too slow)
Copilot Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,36 @@ stages:
ArtifactName: TestResults_Windows_$(_BuildConfig)
condition: failed()

- job: Samples_Windows
displayName: Build Samples
dependsOn: Windows
timeoutInMinutes: 30
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022preview.amd64.open
variables:
_BuildConfig: Release
steps:
- task: PowerShell@2
displayName: 'Install Windows SDK'
inputs:
targetType: filePath
filePath: './eng/install-windows-sdk.ps1'
failOnStderr: true
showWarnings: true

- task: PowerShell@2
displayName: 'Build Samples'
inputs:
targetType: filePath
filePath: './eng/build-samples.ps1'
arguments: '-Configuration $(_BuildConfig)'
failOnStderr: false
showWarnings: true
env:
DOTNET_ROOT: $(Build.SourcesDirectory)/.dotnet
NUGET_PACKAGES: $(Build.SourcesDirectory)/.packages

- job: Linux
timeoutInMinutes: 90
pool:
Expand Down
86 changes: 86 additions & 0 deletions eng/build-samples.ps1
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
)

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
22 changes: 22 additions & 0 deletions samples/public/mstest-runner/Simple1/Simple1.sln
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 samples/public/mstest-runner/runner_vs_vstest/RunnerVsVSTest.sln
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