Skip to content

Commit 60cdd30

Browse files
committed
Merge the microbuild branch from https://github.com/aarnott/Library.Template
Specifically, this merges [663b4c3 from that repo](AArnott/Library.Template@663b4c3).
2 parents c624db4 + 663b4c3 commit 60cdd30

File tree

10 files changed

+152
-99
lines changed

10 files changed

+152
-99
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
2-
FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0.102-noble
33

44
# Installing mono makes `dotnet test` work without errors even for net472.
55
# But installing it takes a long time, so it's excluded by default.

azure-pipelines/Install-NuGetPackage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Param(
3333
[string]$Verbosity='normal'
3434
)
3535

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

3838
try {
3939
Write-Verbose "Installing $PackageId..."

azure-pipelines/apiscan.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
- name: windowsPool
33
type: object
4+
- name: RealSign
5+
type: boolean
46

57
jobs:
68
- job: apiscan
@@ -9,6 +11,12 @@ jobs:
911
pool: ${{ parameters.windowsPool }}
1012
timeoutInMinutes: 120
1113
templateContext:
14+
${{ if not(parameters.RealSign) }}:
15+
mb:
16+
signing: # if the build is test-signed, install the signing plugin so that CSVTestSignPolicy.xml is available
17+
enabled: true
18+
zipSources: false
19+
signType: test
1220
outputs:
1321
- output: pipelineArtifact
1422
displayName: 📢 collect apiscan artifact

azure-pipelines/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,4 @@ jobs:
309309
- template: apiscan.yml
310310
parameters:
311311
windowsPool: ${{ parameters.windowsPool }}
312+
RealSign: ${{ parameters.RealSign }}

azure-pipelines/official.yml

Lines changed: 41 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
trigger:
2-
batch: true
3-
branches:
4-
include:
5-
- main
6-
- 'v*'
7-
- 'validate/*'
8-
paths:
9-
exclude:
10-
- doc/
11-
- '*.md'
12-
- .vscode/
13-
- azure-pipelines/release.yml
14-
- azure-pipelines/vs-insertion.yml
15-
# Disable automatic real-signed builds and insertions
16-
# because we mostly just maintain the repo compliance and freshness without making any shipping changes.
1+
trigger: none # We only want to trigger manually or based on a schedule
2+
pr: none
173
#schedules:
184
#- cron: "0 3 * * *" # Daily @ 8 PM PST
195
# displayName: Daily vs-insertion
@@ -27,10 +13,6 @@ parameters:
2713
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
2814
# If any paramaters should NOT be queue-time options, they should be removed from here
2915
# and references to them in this file replaced with hard-coded values.
30-
- name: ForceOfficialBuild
31-
displayName: Official build (sign, compliance, etc.)
32-
type: boolean
33-
default: false # this should remain false so PR builds using this pipeline are unofficial
3416
# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
3517
# displayName: Skip OptProf optimization
3618
# type: boolean
@@ -59,75 +41,44 @@ variables:
5941
- template: GlobalVariables.yml
6042

6143
extends:
62-
${{ if or(parameters.ForceOfficialBuild, eq(variables['Build.Reason'],'Schedule')) }}:
63-
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
64-
parameters:
65-
sdl:
66-
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
67-
codeSignValidation:
68-
enabled: true
69-
break: true
70-
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
71-
policheck:
72-
enabled: true
73-
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
74-
suppression:
75-
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
76-
sbom:
77-
enabled: true
78-
stages:
79-
- stage: Build
80-
variables:
81-
- template: /azure-pipelines/BuildStageVariables.yml@self
82-
jobs:
83-
- template: /azure-pipelines/build.yml@self
84-
parameters:
85-
Is1ESPT: true
86-
RealSign: true
87-
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
88-
EnableAPIScan: ${{ and(parameters.EnableAPIScan, ne(variables['Build.Reason'], 'pullRequest')) }}
89-
windowsPool: VSEngSS-MicroBuild2022-1ES
90-
linuxPool:
91-
name: AzurePipelines-EO
92-
demands:
93-
- ImageOverride -equals 1ESPT-Ubuntu22.04
94-
os: Linux
95-
macOSPool:
96-
name: Azure Pipelines
97-
vmImage: macOS-14
98-
os: macOS
99-
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
100-
RunTests: ${{ parameters.RunTests }}
101-
- template: /azure-pipelines/prepare-insertion-stages.yml@self
44+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
45+
parameters:
46+
sdl:
47+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
48+
codeSignValidation:
49+
enabled: true
50+
break: true
51+
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
52+
policheck:
53+
enabled: true
54+
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
55+
suppression:
56+
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
57+
sbom:
58+
enabled: true
59+
stages:
60+
- stage: Build
61+
variables:
62+
- template: /azure-pipelines/BuildStageVariables.yml@self
63+
jobs:
64+
- template: /azure-pipelines/build.yml@self
10265
parameters:
66+
Is1ESPT: true
10367
RealSign: true
104-
${{ else }}:
105-
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
106-
parameters:
107-
sdl:
108-
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
109-
suppression:
110-
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
111-
stages:
112-
- stage: Build
113-
variables:
114-
- template: /azure-pipelines/BuildStageVariables.yml@self
115-
jobs:
116-
- template: /azure-pipelines/build.yml@self
117-
parameters:
118-
Is1ESPT: true
119-
RealSign: false
120-
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
121-
EnableAPIScan: false
122-
windowsPool: VSEngSS-MicroBuild2022-1ES
123-
linuxPool:
124-
name: AzurePipelines-EO
125-
demands:
126-
- ImageOverride -equals 1ESPT-Ubuntu22.04
127-
os: Linux
128-
macOSPool:
129-
name: Azure Pipelines
130-
vmImage: macOS-14
131-
os: macOS
132-
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
133-
RunTests: ${{ parameters.RunTests }}
68+
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
69+
EnableAPIScan: ${{ parameters.EnableAPIScan }}
70+
windowsPool: VSEngSS-MicroBuild2022-1ES
71+
linuxPool:
72+
name: AzurePipelines-EO
73+
demands:
74+
- ImageOverride -equals 1ESPT-Ubuntu22.04
75+
os: Linux
76+
macOSPool:
77+
name: Azure Pipelines
78+
vmImage: macOS-14
79+
os: macOS
80+
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
81+
RunTests: ${{ parameters.RunTests }}
82+
- template: /azure-pipelines/prepare-insertion-stages.yml@self
83+
parameters:
84+
RealSign: true

azure-pipelines/unofficial.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- main
6+
- microbuild
7+
- 'validate/*'
8+
paths:
9+
exclude:
10+
- doc/
11+
- '*.md'
12+
- .vscode/
13+
- azure-pipelines/release.yml
14+
- azure-pipelines/vs-insertion.yml
15+
16+
parameters:
17+
# As an entrypoint pipeline yml file, all parameters here show up in the Queue Run dialog.
18+
# If any paramaters should NOT be queue-time options, they should be removed from here
19+
# and references to them in this file replaced with hard-coded values.
20+
# - name: ShouldSkipOptimize # Uncomment this and references to it below when setting EnableOptProf to true in build.yml.
21+
# displayName: Skip OptProf optimization
22+
# type: boolean
23+
# default: false
24+
- name: EnableMacOSBuild
25+
displayName: Build on macOS
26+
type: boolean
27+
default: false # macOS is often bogged down in Azure Pipelines
28+
- name: RunTests
29+
displayName: Run tests
30+
type: boolean
31+
default: true
32+
- name: EnableAPIScan
33+
displayName: Include APIScan with compliance tools
34+
type: boolean
35+
default: false
36+
- name: EnableProductionSDL
37+
displayName: Enable Production SDL
38+
type: boolean
39+
default: false
40+
41+
resources:
42+
repositories:
43+
- repository: MicroBuildTemplate
44+
type: git
45+
name: 1ESPipelineTemplates/MicroBuildTemplate
46+
ref: refs/tags/release
47+
48+
variables:
49+
- template: GlobalVariables.yml
50+
51+
extends:
52+
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
53+
parameters:
54+
sdl:
55+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
56+
suppression:
57+
suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress
58+
enableProductionSDL: ${{ parameters.EnableProductionSDL }}
59+
codeSignValidation:
60+
enabled: ${{ parameters.EnableProductionSDL }}
61+
break: true
62+
additionalTargetsGlobPattern: -|Variables-*\*.ps1;-|APIScanInputs-*\**;-|test_symbols-*\**;-|MicroBuild\**
63+
policyFile: $(MBSIGN_APPFOLDER)\CSVTestSignPolicy.xml
64+
policheck:
65+
enabled: ${{ parameters.EnableProductionSDL }}
66+
exclusionsFile: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml
67+
sbom:
68+
enabled: ${{ parameters.EnableProductionSDL }}
69+
stages:
70+
- stage: Build
71+
variables:
72+
- template: /azure-pipelines/BuildStageVariables.yml@self
73+
jobs:
74+
- template: /azure-pipelines/build.yml@self
75+
parameters:
76+
Is1ESPT: true
77+
RealSign: false
78+
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
79+
EnableAPIScan: ${{ parameters.EnableAPIScan }}
80+
windowsPool: VSEngSS-MicroBuild2022-1ES
81+
linuxPool:
82+
name: AzurePipelines-EO
83+
demands:
84+
- ImageOverride -equals 1ESPT-Ubuntu22.04
85+
os: Linux
86+
macOSPool:
87+
name: Azure Pipelines
88+
vmImage: macOS-14
89+
os: macOS
90+
EnableMacOSBuild: ${{ parameters.EnableMacOSBuild }}
91+
RunTests: ${{ parameters.RunTests }}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.101",
3+
"version": "9.0.102",
44
"rollForward": "patch",
55
"allowPrerelease": false
66
},

test/Directory.Build.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3+
<ItemGroup>
4+
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Condition="Exists('xunit.runner.json')" />
5+
</ItemGroup>
6+
37
<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />
48
</Project>

test/Microsoft.VisualStudio.Validation.Tests/App.config

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"shadowCopy": false
4+
}

0 commit comments

Comments
 (0)