Skip to content

Commit

Permalink
Split build and unit test in Azure Pipelines (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger authored Apr 20, 2024
1 parent 2bb7fda commit dee5c1c
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,24 @@ pr:

stages:
- stage: BuildStage
displayName: Build
displayName: Full Build
dependsOn: []
jobs:
- job: BuildJob
displayName: Build & Unit Tests
displayName: Build
pool:
vmImage: 'windows-2022'
steps:
- template: .azuredevops/pipelines/templates/steps/install-required-dotnet-versions-for-building.yml
- bash: ./build.sh
displayName: 'Build & Run Unit Tests'

- stage: UnitTestStage
displayName: Unit Tests
dependsOn: []
jobs:
- job: UnitTestJob
displayName: Unit Tests
strategy:
matrix:
Windows:
Expand All @@ -27,16 +41,28 @@ stages:
vmImage: $(imageName)
steps:
- template: .azuredevops/pipelines/templates/steps/install-required-dotnet-versions-for-building.yml
- bash: ./build.sh
- bash: ./build.sh --target=Test
displayName: 'Run Unit Tests'

- stage: IntegrationTestsBuildStage
displayName: Build
dependsOn: []
jobs:
- job: CreateNuGetPackagesJob
displayName: Create NuGet Packages
pool:
vmImage: 'ubuntu-22.04'
steps:
- template: .azuredevops/pipelines/templates/steps/install-required-dotnet-versions-for-building.yml
- bash: ./build.sh --target=Create-NuGet-Packages
displayName: 'Build & Run Unit Tests'
- publish: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
artifact: NuGet Package
displayName: 'Publish NuGet package as build artifact'
condition: eq( variables['System.JobName'], 'Windows' )

- stage: IntegrationTestsGitRepositoryStage
displayName: Integration Tests Cake.Issues.GitRepository
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestGitRepositoryScriptingJob
displayName: Test Cake Scripting
Expand Down Expand Up @@ -68,7 +94,7 @@ stages:

- stage: IntegrationTestsMarkdownlintStage
displayName: Integration Tests Cake.Issues.Markdownlint
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestMarkdownlintJob
displayName: Test
Expand Down Expand Up @@ -101,7 +127,7 @@ stages:

- stage: IntegrationTestsMsBuildStage
displayName: Integration Tests Cake.Issues.MsBuild
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestMsBuildJob
displayName: Test
Expand Down Expand Up @@ -130,7 +156,7 @@ stages:

- stage: IntegrationTestsReportingConsoleStage
displayName: Integration Tests Cake.Issues.Reporting.Console
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestReportingConsoleScriptingJob
displayName: Test Cake Scripting
Expand Down Expand Up @@ -183,7 +209,7 @@ stages:

- stage: IntegrationTestsReportingGenericStage
displayName: Integration Tests Cake.Issues.Reporting.Generic
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestReportingGenericScriptingJob
displayName: Test Cake Scripting
Expand Down Expand Up @@ -244,7 +270,7 @@ stages:

- stage: IntegrationTestsReportingSarifStage
displayName: Integration Tests Cake.Issues.Reporting.Sarif
dependsOn: BuildStage
dependsOn: IntegrationTestsBuildStage
jobs:
- job: TestReportingSarifScriptingJob
displayName: Test Cake Scripting
Expand Down

0 comments on commit dee5c1c

Please sign in to comment.