diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 92f8fe457..adbb0439c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,6 +52,9 @@ stages: - stage: Stryker_Mutator displayName: "Stryker Mutator" dependsOn: [] + variables: + - name: StrykerDotNetVersion + value: 8.0.x jobs: - job: Stryker workspace: @@ -63,12 +66,29 @@ stages: packageType: sdk useGlobalJson: true workingDirectory: '$(Build.SourcesDirectory)' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK for Stryker' + inputs: + packageType: sdk + version: $(StrykerDotNetVersion) + + - task: PowerShell@1 + displayName: "Create global.json for .NET" + inputs: + scriptType: inlineScript + workingFolder: $(Agent.TempDirectory) + inlineScript: | + dotnet new globaljson --sdk-version $(StrykerDotNetVersion) + - task: DotNetCoreCLI@2 displayName: "Install Stryker" inputs: command: custom custom: tool + workingDirectory: $(Agent.TempDirectory) arguments: install dotnet-stryker --tool-path $(Agent.BuildDirectory)/tools + - task: Powershell@2 displayName: "Run Stryker" inputs: @@ -76,8 +96,9 @@ stages: targetType: 'inline' pwsh: true script: $(Agent.BuildDirectory)/tools/dotnet-stryker + - task: PublishMutationReport@0 - displayName: 'Publish Strkyer Mutator Report' + displayName: 'Publish Stryker Mutator Report' inputs: reportPattern: '**/mutation-report.html'