-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
72 lines (61 loc) · 2.11 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
trigger:
- master
- develop
pool:
vmImage: 'VS2017-Win2016'
variables:
buildConfiguration: 'Release'
Major: '0'
Minor: '1'
Patch: '0'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- script: |
mkdir $(Build.SourcesDirectory)\results
dotnet test --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura Slng.MFLApi.Test
displayName: 'Unit testing'
- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.12
.\reportgenerator "-reports:$(Build.SourcesDirectory)\Slng.MFLApi.Test\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart"
displayName: 'Testreport generation'
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)\Slng.MFLApi.Test\
contents: coverage.cobertura.xml
targetFolder: $(Build.SourcesDirectory)\results
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(Build.SourcesDirectory)\results\coverage.cobertura.xml
reportDirectory: $(Build.SourcesDirectory)\results
codecoverageTool: cobertura
- task: DotNetCoreCLI@2
displayName: 'Create NuGet package'
inputs:
command: pack
packagesToPack: '**/Slng.MFLApi.csproj'
packDestination: '$(Build.ArtifactStagingDirectory)'
configuration: $(buildConfiguration)
versioningScheme: byPrereleaseNumber
majorVersion: '$(Major)'
minorVersion: '$(Minor)'
patchVersion: '$(Patch)'
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
projects: Slng.MFLApi/Slng.MFLApi.csproj
publishWebProjects: false
modifyOutputPath: true
zipAfterPublish: true
- task: NuGetCommand@2
displayName: 'Publish prerelease to nuget.org'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'MFL_NuGet_org'