Skip to content

Commit

Permalink
Create internal CI & PR builds (#579)
Browse files Browse the repository at this point in the history
Refactor yaml and create internal CI/PR builds
  • Loading branch information
WilliamXieMSFT authored Mar 27, 2024
1 parent 2805f64 commit cfceec5
Show file tree
Hide file tree
Showing 15 changed files with 145 additions and 83 deletions.
4 changes: 2 additions & 2 deletions build/yaml/jobs/linux/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- checkout: self
clean: true

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/signing.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand All @@ -42,7 +42,7 @@ jobs:
parameters:
OneESPT: ${{ parameters.OneESPT }}

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/codesignverify.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand Down
4 changes: 2 additions & 2 deletions build/yaml/jobs/windows/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- template: ../../steps/azuredevops/usedotnet.yaml@self

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/signing.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand All @@ -51,7 +51,7 @@ jobs:
IsMicroBuildInternal: ${{ parameters.IsMicroBuildInternal }}
OneESPT: ${{ parameters.OneESPT }}

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/codesignverify.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand Down
4 changes: 2 additions & 2 deletions build/yaml/jobs/windows/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- checkout: self
clean: true

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/signing.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand All @@ -47,7 +47,7 @@ jobs:
WindowsBinRoot: $(Build.ArtifactStagingDirectory)\binaries-windows-$(Configuration)
OneESPT: ${{ parameters.OneESPT }}

- ${{ if eq('true', parameters.IsMicroBuildInternal) }}:
- ${{ if and(eq('true', parameters.IsMicroBuildInternal), notIn(parameters.SignType, '', 'None')) }}:
- template: ../../steps/microbuild/codesignverify.yaml@self
parameters:
SignType: ${{ parameters.SignType }}
Expand Down
29 changes: 4 additions & 25 deletions build/yaml/pipelines/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,7 @@ variables:
TeamName: ClrInstrumentationEngine

stages:
- stage: Build
jobs:
# Binaries (Windows & Linux)
- template: ../jobs/binaries.yaml@self
parameters:
IndexSources: true
Configuration: Both
OneESPT: false

- stage: Test
dependsOn: Build
jobs:
# Tests (Windows)
- template: ../jobs/tests.yaml@self
parameters:
Configuration: Both

- stage: Package
dependsOn: Build
jobs:
# Packages (Windows & Linux)
- template: ../jobs/packages.yaml@self
parameters:
Configuration: Both
OneESPT: false
- template: ../stages/build_and_package.yaml@self
parameters:
OneESPT: false
IsMicroBuildInternal: false
39 changes: 39 additions & 0 deletions build/yaml/pipelines/ci_internal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# Build Pipeline: Continuous Integration (Internal)
# Validates:
# - binaries can be built for all platforms and configurations
# - packages can be built for all platforms and configurations

name: $(date:yyyyMMdd)$(rev:rr)

variables:
TeamName: ClrInstrumentationEngine

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

extends:
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
parameters:
pool:
name: VSEngSS-Microbuild2022-1ES
os: windows
sdl:
sourceAnalysisPool:
name: VSEngSS-MicroBuild2022-1ES
os: windows
binskim:
enabled: false
justificationForDisabling: 'Currently fails for debug builds. Disabling because we run binSkim in a separate pipeline.'

stages:
- template: ../stages/build_and_package.yaml@self
parameters:
OneESPT: true
IsMicroBuildInternal: true
28 changes: 4 additions & 24 deletions build/yaml/pipelines/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,7 @@ variables:
TeamName: ClrInstrumentationEngine

stages:
- stage: Build
jobs:
# Binaries (Windows & Linux)
- template: ../jobs/binaries.yaml@self
parameters:
Configuration: Both
OneESPT: false

- stage: Test
dependsOn: Build
jobs:
# Tests (Windows)
- template: ../jobs/tests.yaml@self
parameters:
Configuration: Both

- stage: Package
dependsOn: Build
jobs:
# Packages (Windows & Linux)
- template: ../jobs/packages.yaml@self
parameters:
Configuration: Both
OneESPT: false
- template: ../stages/build_and_package.yaml@self
parameters:
OneESPT: false
IsMicroBuildInternal: false
39 changes: 39 additions & 0 deletions build/yaml/pipelines/pr_internal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# Build Pipeline: Pull Request (Internal)
# Validates:
# - binaries can be built for all platforms and configurations
# - packages can be built for all platforms and configurations

name: $(date:yyyyMMdd)$(rev:rr)

variables:
TeamName: ClrInstrumentationEngine

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

extends:
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
parameters:
pool:
name: VSEngSS-Microbuild2022-1ES
os: windows
sdl:
sourceAnalysisPool:
name: VSEngSS-MicroBuild2022-1ES
os: windows
binskim:
enabled: false
justificationForDisabling: 'Currently fails for debug builds. Disabling because we run binSkim in a separate pipeline.'

stages:
- template: ../stages/build_and_package.yaml@self
parameters:
OneESPT: true
IsMicroBuildInternal: true
27 changes: 7 additions & 20 deletions build/yaml/pipelines/signed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,13 @@ extends:
scanOutputDirectoryOnly: true # BinSkim will complain about VC.Tools not being Spectre compliant, but we use that for builds. This toggles for BinSkim to only scan the output files/folders.

stages:
- stage: Build
jobs:
# Binaries (Windows & Linux)
- template: /build/yaml/jobs/binaries.yaml@self
parameters:
IndexSources: true
SignType: $(SignType) # NOTE this string won't be replaced until runtime
Configuration: Release
IsMicroBuildInternal: true
OneESPT: true

- stage: Package
jobs:
# Packages (Windows & Linux)
- template: /build/yaml/jobs/packages.yaml@self
parameters:
SignType: $(SignType) # NOTE this string won't be replaced until runtime
Configuration: Release
IsMicroBuildInternal: true
OneESPT: true
- template: ../stages/build_and_package.yaml@self
parameters:
OneESPT: true
IsMicroBuildInternal: true
IncludeTests: false
Configuration: Release
SignType: $(SignType) # NOTE this string won't be replaced until runtime

- stage: PostPackage
jobs:
Expand Down
39 changes: 39 additions & 0 deletions build/yaml/stages/build_and_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
OneESPT: false
IsMicroBuildInternal: false
IncludeTests: true
Configuration: Both
SignType: None

stages:
- stage: Build
jobs:
# Binaries (Windows & Linux)
- template: ../jobs/binaries.yaml@self
parameters:
SignType: ${{ parameters.SignType}}
IndexSources: true
Configuration: ${{ parameters.Configuration }}
OneESPT: ${{ parameters.OneESPT }}
IsMicroBuildInternal: ${{ parameters.IsMicroBuildInternal }}

- ${{ if eq('true', parameters.IncludeTests) }}:
- stage: Test
dependsOn: Build
jobs:
# Tests (Windows)
- template: ../jobs/tests.yaml@self
parameters:
Configuration: ${{ parameters.Configuration }}
IsMicroBuildInternal: ${{ parameters.IsMicroBuildInternal }}

- stage: Package
dependsOn: Build
jobs:
# Packages (Windows & Linux)
- template: ../jobs/packages.yaml@self
parameters:
SignType: ${{ parameters.SignType}}
Configuration: ${{ parameters.Configuration }}
OneESPT: ${{ parameters.OneESPT }}
IsMicroBuildInternal: ${{ parameters.IsMicroBuildInternal }}
1 change: 1 addition & 0 deletions src/Extensions.Base/Extensions.Base.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Midl>
<HeaderFileName>HostExtension_i.h</HeaderFileName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<AdditionalIncludeDirectories>$(OutDir);..\..\inc;..\..\inc\clr\inc;$(InstrumentationEngineApiInc);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<CETCompat Condition="'$(Platform)'!='ARM64'">true</CETCompat>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<PreprocessorDefinitions>_WINDOWS;_USRDLL;INSTRUMENTATIONENGINEPROFILERPROXY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<CETCompat Condition="'$(Platform)'!='ARM64'">true</CETCompat>
Expand All @@ -96,6 +97,7 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/InstrumentationEngine/InstrumentationEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<ExceptionHandling>Async</ExceptionHandling>
<AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<CETCompat Condition="'$(Platform)'!='ARM64'">true</CETCompat>
Expand Down Expand Up @@ -113,7 +114,6 @@
<PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">X86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ControlFlowGuard>Guard</ControlFlowGuard>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
Expand Down
5 changes: 1 addition & 4 deletions src/Tests/CommonLibTests/CommonLibTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<ClCompile>
<AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>$(EnlistmentRoot)\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand All @@ -93,7 +94,6 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -109,7 +109,6 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -124,7 +123,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -141,7 +139,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<ClCompile>
<AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>$(EnlistmentRoot)\src;$(EnlistmentRoot)\inc\clr\prof;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down Expand Up @@ -108,7 +109,6 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -123,7 +123,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -140,7 +139,6 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand Down

0 comments on commit cfceec5

Please sign in to comment.