-
Notifications
You must be signed in to change notification settings - Fork 9
/
azure-pipelines.yml
52 lines (46 loc) · 1.84 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
trigger:
- "*"
name: $(Date:yyyyMMdd)$(Rev:.r)
jobs:
- job: buildNugetPackage
displayName: "Build packages"
pool:
vmImage: 'ubuntu-latest'
variables:
sourceDirectory: $(System.DefaultWorkingDirectory)
buildConfiguration: 'Release'
testResultsDirectory: $(System.DefaultWorkingDirectory)/TestResults
coverageSummaryFile: $(testResultsDirectory)/**/coverage.cobertura.xml
steps:
- task: DotNetCoreCLI@2
displayName: "Restore solution"
inputs:
command: 'restore'
projects: '$(sourceDirectory)'
feedsToUse: 'select'
vstsFeed: 'ProcessorArtifacts'
- script: dotnet test $(sourceDirectory) --configuration Debug --no-restore --logger trx
displayName: 'Run tests'
- task: PublishTestResults@2
displayName: "Publish test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*.trx'
searchFolder: '$(testResultsDirectory)'
failTaskOnFailedTests: true
buildConfiguration: '$(buildConfiguration)'
- task: PublishCodeCoverageResults@1
displayName: "Publish code coverage"
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(coverageSummaryFile)
- powershell: |
$cmd = 'dotnet pack --configuration $(buildConfiguration) --output "$(Build.ArtifactStagingDirectory)" --verbosity Normal'
If ('$(ShouldOverridePackageVersion)' -Eq 'true') { $cmd += ' -p:PackageVersion=$(OverridenPackageVersion)' }
Write-Output "ShouldOverridePackageVersion: $(ShouldOverridePackageVersion)";
Write-Output "$cmd"
Invoke-Expression $cmd;
displayName: 'Pack projects'
- publish: "$(Build.ArtifactStagingDirectory)"
artifact: drop
displayName: 'Publish Artifacts: drop'