-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.yml
87 lines (72 loc) · 2.75 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
# Azure DevOps Pipeline
name: $(Date:yyyyMMdd)$(Rev:r)
trigger:
- main
stages:
- stage: BuildNuget
displayName: 'Build NuGet packages'
jobs:
- job: BuildTestPackageNuGet
displayName: 'Build'
strategy:
matrix:
Windows:
vmImage: 'windows-latest'
artifactName: 'nuget-windows'
macOS:
vmImage: 'macOS-latest'
artifactName: 'nuget-macos'
Linux:
vmImage: 'ubuntu-latest'
artifactName: 'nuget-linux'
maxParallel: 3
pool:
vmImage: '$(vmImage)'
variables:
dotnetBuildConfiguration: 'Release'
dotnetVerbosity: 'Detailed'
pathToBuildProjects: '**/**/*.*sproj'
pathToTestProjects: '**/test/**/*.Test.*sproj'
pathToPackProjects: '**/src/**/*.*sproj'
pathToNugetPackages: '**/*.nupkg'
sourceRepositoryBranch: '$(Build.SourceBranchName)'
sourceRepositoryCommit: '$(Build.SourceVersion)'
steps:
- task: UseDotNet@2
displayName: 'Install: .NET Core SDK'
inputs:
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '$(pathToBuildProjects)'
arguments: '--verbosity $(dotnetVerbosity)'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: build
projects: '$(pathToBuildProjects)'
arguments: '--configuration $(dotnetBuildConfiguration) --verbosity $(dotnetVerbosity)'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack: ci'
inputs:
command: custom
custom: pack
projects: '$(pathToPackProjects)'
arguments: '--output "$(Build.ArtifactStagingDirectory)/ci" --configuration $(dotnetBuildConfiguration) --verbosity $(dotnetVerbosity) /p:Configuration=$(dotnetBuildConfiguration) /p:RepositoryBranch=$(sourceRepositoryBranch) /p:RepositoryCommit=$(sourceRepositoryCommit) /p:VersionSuffix=ci-$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack: release'
inputs:
command: custom
custom: pack
projects: '$(pathToPackProjects)'
arguments: '--output "$(Build.ArtifactStagingDirectory)/release" --configuration $(dotnetBuildConfiguration) --verbosity $(dotnetVerbosity) /p:Configuration=$(dotnetBuildConfiguration) /p:RepositoryBranch=$(sourceRepositoryBranch) /p:RepositoryCommit=$(sourceRepositoryCommit)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '$(pathToTestProjects)'
arguments: '--configuration $(dotnetBuildConfiguration) --collect "Code coverage" -- Expecto.fail-on-focused-tests=true'
- publish: '$(Build.ArtifactStagingDirectory)'
artifact: '$(artifactName)'