Created
December 23, 2022 13:58
-
-
Save kek-Sec/6dd81d2f4b0a6b6cca1cef469645a5b4 to your computer and use it in GitHub Desktop.
Azure DevOps - Build and test a .NET 6 project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .NET 6 Pipeline | |
# Build and test a .NET 6 project | |
# Triggers the pipeline on pushes to the master branch | |
# https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core | |
trigger: | |
branches: | |
include: | |
- master | |
# specify the pool for the pipeline | |
pool: | |
vmImage: 'ubuntu-latest' | |
# specify the steps for the pipeline | |
steps: | |
- task: UseDotNet@2 | |
inputs: | |
packageType: sdk | |
version: '6.0.100' | |
- script: dotnet restore | |
displayName: 'dotnet restore' | |
- script: dotnet build | |
displayName: 'dotnet build' | |
- script: dotnet test | |
displayName: 'dotnet test' | |
- task: PublishTestResults@2 | |
inputs: | |
testResultsFormat: 'VSTest' | |
testResultsFiles: '**/*.trx' | |
- task: PublishBuildArtifacts@1 | |
inputs: | |
pathToPublish: '$(Build.ArtifactStagingDirectory)' | |
artifactName: 'build-artifact' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment