-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
107 lines (86 loc) · 3.71 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# 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:
branches:
include:
- master
- develop
paths:
exclude:
- README.md
- CHANGELOG.md
- CONTRIBUTING.md
pool:
vmImage: 'vs2017-win2016'
variables:
BuildConfiguration: 'Release'
DotNetCoreVersion: '2.2.106'
BuildPlatform: 'Any CPU'
major: 1
minor: 0
# creates a counter called versioncounter and seeds it at 100 and then assigns the value to a variable named buildNo.
buildNo: $[counter('geomversioncounter', 100)]
version: '$(major).$(minor).$(buildNo)'
PreReleaseVersion: '1.0.0-beta-2'
DoPreRelease: false
steps:
- script: echo Build.Reason:$(Build.Reason) version:$(version) DoPreRelease:$(DoPreRelease)
displayName: 'BuildNumber'
- task: DotNetCoreInstaller@0
displayName: Install .NET Core $(DotNetCoreVersion)
inputs:
version: $(DotNetCoreVersion)
- script: dotnet tool install --global dotnet-sonarscanner
displayName: 'Install dotnet-sonarscanner'
- script: dotnet tool install --global dotnet-testx
displayName: 'Install dotnet-testx'
- script: dotnet restore ./src/GraphQL-AspNetCore-2.2.sln
displayName: dotnet restore
- script: dotnet build --configuration $(buildConfiguration) /p:AssemblyVersion=$(version) ./src/GraphQL-AspNetCore-2.2.sln
displayName: 'dotnet build $(buildConfiguration)'
# do this after your tests have run
- script: dotnet test ./src/XUnitServer_App_Identity/XUnitServer_App_Identity.csproj --logger trx --collect "Code coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,lcov\" /p:CoverletOutput=../lcov
displayName: dotnet test XUnitServer_App_Identity
- script: dotnet test ./src/XUnitServer_OAuth2/XUnitServer_OAuth2.csproj --logger trx --collect "Code coverage"
displayName: dotnet test XUnitServer_OAuth2
- script: dotnet test ./src/XUnitServer_TokenExchange/XUnitServer_TokenExchange.csproj --logger trx --collect "Code coverage"
displayName: dotnet test XUnitServer_TokenExchange
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: pack
packagesToPack: '**/*.sln'
versioningScheme: byPrereleaseNumber
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
- task: DotNetCoreCLI@2
displayName: 'Pack Manual'
inputs:
command: pack
packagesToPack: '**/*.sln'
versioningScheme: byEnvVar
versionEnvVar: PreReleaseVersion
condition: and(succeeded(), eq(variables['DoPreRelease'], 'true'))
#- task: DotNetCoreCLI@2
# displayName: Push
# inputs:
# command: push
# publishVstsFeed: '71e2807a-04c6-4cfa-80f3-69644ad1d3e0'
#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
- task: DotNetCoreCLI@2
displayName: 'Publish Website'
inputs:
command: publish
publishWebProjects: true
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)/publish --no-restore --no-build'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact Test'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()