Skip to content

Instantly share code, notes, and snippets.

@kek-Sec
Created December 23, 2022 13:58
Show Gist options
  • Save kek-Sec/6dd81d2f4b0a6b6cca1cef469645a5b4 to your computer and use it in GitHub Desktop.
Save kek-Sec/6dd81d2f4b0a6b6cca1cef469645a5b4 to your computer and use it in GitHub Desktop.
Azure DevOps - Build and test a .NET 6 project
# .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