Skip to content

Instantly share code, notes, and snippets.

@samlucax
Created July 8, 2020 12:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samlucax/c6e226adcee43eaf56048fae88bd3ebd to your computer and use it in GitHub Desktop.
Save samlucax/c6e226adcee43eaf56048fae88bd3ebd to your computer and use it in GitHub Desktop.
pool:
name: Azure Pipelines
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '**/<NomeDoSeuProjeto>/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '**/<NomeDoSeuProjeto>/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Unit tests'
inputs:
command: test
projects: '**/<NomeDoSeuProjeto>.UnitTests.csproj'
arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true'
continueOnError: true
- task: DotNetCoreCLI@2
displayName: 'Funcional tests'
inputs:
command: test
projects: '**/<NomeDoSeuProjeto>.Tests.csproj'
arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"'
continueOnError: true
- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8'
displayName: 'Install ReportGenerator tool'
- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"'
displayName: 'Create reports'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment