DSInternals/azure-pipelines.yml

215 lines
5.8 KiB
YAML
Raw Permalink Normal View History

# Azure Pipelines Build Configuration
2018-09-29 07:10:41 +00:00
trigger:
batch: true
branches:
include:
- master
paths:
include:
- Src/*
pr:
branches:
include:
- master
paths:
exclude:
- '**/*.md'
2018-09-29 07:10:41 +00:00
variables:
solution: '**/*.sln'
packagesFolder: 'Build/packages'
2018-09-29 07:10:41 +00:00
jobs:
- job: Test
displayName: 'Test'
pool:
2023-09-16 19:51:51 +00:00
vmImage: 'windows-2022'
variables:
buildConfiguration: 'Debug'
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
- task: NuGetCommand@2
displayName: 'NuGet Restore Packages'
inputs:
command: 'restore'
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) x86)'
inputs:
solution: '$(solution)'
platform: 'x86'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) x64)'
inputs:
solution: '$(solution)'
platform: 'x64'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
2023-09-16 19:38:23 +00:00
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) ARM64)'
inputs:
solution: '$(solution)'
platform: 'ARM64'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
- task: VSTest@2
displayName: 'VSTest Unit Tests'
inputs:
testRunTitle: 'VSTest Unit Tests'
testSelector: 'testAssemblies'
testAssemblyVer2: 'Build/**/DSInternals/*.Test.dll'
codeCoverageEnabled: false
configuration: '$(buildConfiguration)'
# Only proceed with the Release build if Test succeeds and the build was requested manually.
- job: Release
displayName: 'Release'
dependsOn: Test
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
pool:
2023-09-16 19:51:51 +00:00
vmImage: 'windows-2022'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
- task: NuGetCommand@2
displayName: 'NuGet Restore Packages'
inputs:
command: 'restore'
restoreSolution: '$(solution)'
- task: DownloadSecureFile@1
displayName: 'Download SNK File'
inputs:
secureFile: 'DSInternals.Private.snk'
- task: CopyFiles@2
displayName: 'Copy SNK File to Keys'
inputs:
sourceFolder: '$(Agent.TempDirectory)'
contents: '*.snk'
targetFolder: 'Keys'
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) x86)'
inputs:
solution: '$(solution)'
platform: 'x86'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) x64)'
inputs:
solution: '$(solution)'
platform: 'x64'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
2023-09-16 19:51:51 +00:00
- task: VSBuild@1
displayName: 'VSBuild ($(buildConfiguration) ARM64)'
inputs:
solution: '$(solution)'
platform: 'ARM64'
configuration: '$(buildConfiguration)'
restoreNugetPackages: false
- task: PowerShell@2
displayName: 'ZIP Pack (PowerShell Module)'
inputs:
targetType: 'filePath'
filePath: 'Scripts/Pack-PSModule.ps1'
- task: PowerShell@2
displayName: 'Chocolatey Pack (PowerShell Module)'
inputs:
targetType: 'filePath'
filePath: 'Scripts/Pack-Chocolatey.ps1'
- task: NuGetCommand@2
displayName: 'NuGet Pack (DSInternals.Common)'
inputs:
command: 'pack'
packagesToPack: '**/DSInternals.Common.csproj'
configuration: '$(BuildConfiguration)'
packDestination: '$(packagesFolder)/NuGet'
includeReferencedProjects: true
verbosityPack: 'detailed'
- task: NuGetCommand@2
displayName: 'NuGet Pack (DSInternals.DataStore)'
inputs:
command: 'pack'
packagesToPack: '**/DSInternals.DataStore.csproj'
configuration: '$(BuildConfiguration)'
packDestination: '$(packagesFolder)/NuGet'
includeReferencedProjects: true
verbosityPack: 'detailed'
- task: NuGetCommand@2
displayName: 'NuGet Pack (DSInternals.Replication)'
inputs:
command: 'pack'
packagesToPack: '**/DSInternals.Replication.csproj'
configuration: '$(BuildConfiguration)'
packDestination: '$(packagesFolder)/NuGet'
includeReferencedProjects: true
verbosityPack: 'detailed'
- task: NuGetCommand@2
displayName: 'NuGet Pack (DSInternals.SAM)'
inputs:
command: 'pack'
packagesToPack: '**/DSInternals.SAM.csproj'
configuration: '$(BuildConfiguration)'
packDestination: '$(packagesFolder)/NuGet'
includeReferencedProjects: true
verbosityPack: 'detailed'
- task: PublishBuildArtifacts@1
displayName: 'Publish NuGet Packages'
inputs:
pathtoPublish: '$(packagesFolder)/NuGet'
artifactName: 'NuGet'
- task: PublishBuildArtifacts@1
displayName: 'Publish Chocolatey Package'
inputs:
pathtoPublish: '$(packagesFolder)/Chocolatey'
artifactName: 'Chocolatey'
- task: PublishBuildArtifacts@1
displayName: 'Publish GitHub Package'
inputs:
pathtoPublish: '$(packagesFolder)/Module'
artifactName: 'GitHub'
- task: PowerShell@2
displayName: 'Run Smoke Tests'
inputs:
targetType: 'filePath'
filePath: 'Scripts/Invoke-SmokeTests.ps1'
- task: PublishTestResults@2
displayName: 'Publish Smoke Test Results'
inputs:
testRunTitle: 'Pester Smoke Tests'
testResultsFormat: 'NUnit'
testResultsFiles: '**/*.xml'
searchFolder: 'TestResults'