Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build pipeline test #133

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
vmImage: windows-latest

variables:
buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: dotnet build --configuration $(buildConfiguration) --source '$(Build.SourcesDirectory)/C:/Users/gabri/Desktop/COM769-B00575451-WebApp'
displayName: 'dotnet build $(buildConfiguration)'

- script: |
cd '$(Build.SourcesDirectory)/C:/Users/gabri/Desktop/COM769-B00575451-WebApp'
dotnet test --configuration $(buildConfiguration) --logger trx --results-directory $(Build.ArtifactStagingDirectory)/test-results /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
displayName: 'dotnet test'

- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Build.ArtifactStagingDirectory)/test-results/*.trx'
searchFolder: '$(Build.SourcesDirectory)/C:/Users/gabri/Desktop/COM769-B00575451-WebApp'
mergeTestResults: true
failTaskOnFailedTests: true
publishRunAttachments: true
testRunTitle: 'Unit Tests'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/test-results/coverage.cobertura.xml'
reportDirectory: '$(Build.ArtifactStagingDirectory)/codecoverage'
additionalCodeCoverageFiles: |
$(Build.SourcesDirectory)/C:/Users/gabri/Desktop/COM769-B00575451-WebApp/**/coverage.cobertura.xml