Skip to content
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

Merge latest Library.Template #1373

Merged
merged 9 commits into from
Jan 15, 2025
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble
FROM mcr.microsoft.com/dotnet/sdk:9.0.102-noble

# Installing mono makes `dotnet test` work without errors even for net472.
# But installing it takes a long time, so it's excluded by default.
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/Install-NuGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Param(
[string]$Verbosity='normal'
)

$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1"
$nugetPath = & "$PSScriptRoot\..\tools\Get-NuGetTool.ps1"

try {
Write-Verbose "Installing $PackageId..."
Expand Down
8 changes: 8 additions & 0 deletions azure-pipelines/apiscan.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
parameters:
- name: windowsPool
type: object
- name: RealSign
type: boolean

jobs:
- job: apiscan
Expand All @@ -9,6 +11,12 @@ jobs:
pool: ${{ parameters.windowsPool }}
timeoutInMinutes: 120
templateContext:
${{ if not(parameters.RealSign) }}:
mb:
signing: # if the build is test-signed, install the signing plugin so that CSVTestSignPolicy.xml is available
enabled: true
zipSources: false
signType: test
outputs:
- output: pipelineArtifact
displayName: 📢 collect apiscan artifact
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,4 @@ jobs:
- template: apiscan.yml
parameters:
windowsPool: ${{ parameters.windowsPool }}
RealSign: ${{ parameters.RealSign }}
130 changes: 41 additions & 89 deletions azure-pipelines/official.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
trigger:
batch: true
branches:
include:
- main
- 'v16.*'
- 'v17.*'
- 'validate/*'
paths:
exclude:
- doc/
- '*.md'
- .vscode/
- azure-pipelines/release.yml
- azure-pipelines/vs-insertion.yml
trigger: none # We only want to trigger manually or based on a schedule
pr: none
schedules:
- cron: "0 3 * * *" # Daily @ 8 PM PST
displayName: Daily vs-insertion
Expand All @@ -24,10 +11,6 @@ parameters:
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
# If any paramaters should NOT be queue-time options, they should be removed from here
# and references to them in this file replaced with hard-coded values.
- name: ForceOfficialBuild
displayName: Official build (sign, compliance, etc.)
type: boolean
default: false # this should remain false so PR builds using this pipeline are unofficial
- name: ShouldSkipOptimize
displayName: Skip OptProf optimization
type: boolean
Expand Down Expand Up @@ -56,75 +39,44 @@ variables:
- template: GlobalVariables.yml

extends:
${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
codeSignValidation:
enabled: true
break: true
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
policheck:
enabled: true
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
suppression:
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
sbom:
enabled: true
stages:
- stage: Build
variables:
- template: /azure-pipelines/BuildStageVariables.yml@self
jobs:
- template: /azure-pipelines/build.yml@self
parameters:
Is1ESPT: true
RealSign: true
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
windowsPool: VSEngSS-MicroBuild2022-1ES
linuxPool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals 1ESPT-Ubuntu22.04
os: Linux
macOSPool:
name: Azure Pipelines
vmImage: macOS-14
os: macOS
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
RunTests: ${{ parameters.RunTests }}
- template: /azure-pipelines/prepare-insertion-stages.yml@self
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
codeSignValidation:
enabled: true
break: true
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
policheck:
enabled: true
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
suppression:
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
sbom:
enabled: true
stages:
- stage: Build
variables:
- template: /azure-pipelines/BuildStageVariables.yml@self
jobs:
- template: /azure-pipelines/build.yml@self
parameters:
Is1ESPT: true
RealSign: true
${{ else }}:
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
suppression:
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
stages:
- stage: Build
variables:
- template: /azure-pipelines/BuildStageVariables.yml@self
jobs:
- template: /azure-pipelines/build.yml@self
parameters:
Is1ESPT: true
RealSign: false
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: false
windowsPool: VSEngSS-MicroBuild2022-1ES
linuxPool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals 1ESPT-Ubuntu22.04
os: Linux
macOSPool:
name: Azure Pipelines
vmImage: macOS-14
os: macOS
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
RunTests: ${{ parameters.RunTests }}
ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: ${{ parameters.EnableAPIScan }}
windowsPool: VSEngSS-MicroBuild2022-1ES
linuxPool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals 1ESPT-Ubuntu22.04
os: Linux
macOSPool:
name: Azure Pipelines
vmImage: macOS-14
os: macOS
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
RunTests: ${{ parameters.RunTests }}
- template: /azure-pipelines/prepare-insertion-stages.yml@self
parameters:
RealSign: true
92 changes: 92 additions & 0 deletions azure-pipelines/unofficial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
trigger:
batch: true
branches:
include:
- main
- 'v16.*'
- 'v17.*'
- 'validate/*'
paths:
exclude:
- doc/
- '*.md'
- .vscode/
- azure-pipelines/release.yml
- azure-pipelines/vs-insertion.yml

parameters:
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
# If any paramaters should NOT be queue-time options, they should be removed from here
# and references to them in this file replaced with hard-coded values.
# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
# displayName: Skip OptProf optimization
# type: boolean
# default: false
- name: EnableMacOSBuild
displayName: Build on macOS
type: boolean
default: false # macOS is often bogged down in Azure Pipelines
- name: RunTests
displayName: Run tests
type: boolean
default: true
- name: EnableAPIScan
displayName: Include APIScan with compliance tools
type: boolean
default: false
- name: EnableProductionSDL
displayName: Enable Production SDL
type: boolean
default: false

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release

variables:
- template: GlobalVariables.yml

extends:
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
suppression:
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
enableProductionSDL: ${{ parameters.EnableProductionSDL }}
codeSignValidation:
enabled: ${{ parameters.EnableProductionSDL }}
break: true
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
policyFile: $(MBSIGN_APPFOLDER)\CSVTestSignPolicy.xml
policheck:
enabled: ${{ parameters.EnableProductionSDL }}
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
sbom:
enabled: ${{ parameters.EnableProductionSDL }}
stages:
- stage: Build
variables:
- template: /azure-pipelines/BuildStageVariables.yml@self
jobs:
- template: /azure-pipelines/build.yml@self
parameters:
Is1ESPT: true
RealSign: false
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
EnableAPIScan: ${{ parameters.EnableAPIScan }}
windowsPool: VSEngSS-MicroBuild2022-1ES
linuxPool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals 1ESPT-Ubuntu22.04
os: Linux
macOSPool:
name: Azure Pipelines
vmImage: macOS-14
os: macOS
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
RunTests: ${{ parameters.RunTests }}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.101",
"version": "9.0.102",
"rollForward": "patch",
"allowPrerelease": false
},
Expand Down
4 changes: 4 additions & 0 deletions test/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Condition="Exists('xunit.runner.json')" />
</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"shadowCopy": false
}
4 changes: 1 addition & 3 deletions test/Microsoft.VisualStudio.Threading.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<add key="Microsoft.VisualStudio.Threading.NET45Mode" value="false" />
<!-- Set this setting to "true" to test Windows 7 mode. -->
<add key="Microsoft.VisualStudio.Threading.Windows7Mode" value="false"/>
<add key="xunit.methodDisplay" value="method" />
<add key="xunit.shadowCopy" value="false"/>
</appSettings>

</configuration>
</configuration>
5 changes: 5 additions & 0 deletions test/Microsoft.VisualStudio.Threading.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"shadowCopy": false,
"methodDisplay": "method"
}