This repository has been archived by the owner on Dec 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
azure-pipeline.yml
128 lines (111 loc) · 3.6 KB
/
azure-pipeline.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
trigger:
branches:
include: ["master"]
paths:
exclude: ["doc", "*.md", ".appveyor.yml", ".travis.yml"]
variables:
# TreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
BuildPlatform: Any CPU
resources:
containers:
- container: xenial
image: andrewarnott/linux-buildagent
jobs:
- job: Windows
pool:
vmImage: 'windows-2019'
steps:
- task: UseDotNet@2
displayName: Install/select .NET Core SDK
inputs:
useGlobalJson: true
- script: |
dotnet tool restore
dotnet nbgv cloud -p src
displayName: Set build number
condition: ne(variables['system.pullrequest.isfork'], true)
- script: dotnet --info
displayName: Show dotnet SDK info
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
inputs:
command: custom
custom: restore
projects: src/**/*.sln
- task: DotNetCoreCLI@2
displayName: Build solutions
inputs:
command: custom
custom: build
projects: src/**/*.sln
arguments: -t:build,pack --no-restore -m -c $(BuildConfiguration) -bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
- task: DotNetCoreCLI@2
displayName: Run tests
inputs:
command: test
workingDirectory: src
arguments: -v n --no-build -c $(BuildConfiguration)
- task: CopyFiles@1
displayName: Collecting project.assets.json artifacts
inputs:
Contents: |
obj/**/project.assets.json
TargetFolder: $(Build.ArtifactStagingDirectory)/projectAssetsJson
condition: succeededOrFailed()
- task: CopyFiles@1
displayName: Collecting deployables
inputs:
Contents: |
bin/**/$(BuildConfiguration)/**/*.nupkg
bin/**/$(BuildConfiguration)/**/*.snupkg
TargetFolder: $(Build.ArtifactStagingDirectory)/deployables
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: Publish projectAssetsJson artifacts
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/projectAssetsJson
ArtifactName: projectAssetsJson
ArtifactType: Container
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
- task: PublishBuildArtifacts@1
displayName: Publish build_logs artifacts
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/build_logs
ArtifactName: build_logs
ArtifactType: Container
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
## The rest of these steps are for deployment and skipped for PR builds
#- task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: $(build.sourcesdirectory)/bin
# ArtifactName: bin
# ArtifactType: Container
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['system.pullrequest.isfork'], true))
- task: PublishBuildArtifacts@1
displayName: Publish deployables artifacts
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables
ArtifactName: deployables
ArtifactType: Container
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['system.pullrequest.isfork'], true))
- job: Linux
pool:
vmImage: Ubuntu 16.04
container: xenial
variables:
GitLinkEnabled: false
steps:
- template: azure-pipelines/testfx.yml
parameters:
projectdirectory: src/CodeGeneration.Roslyn.Tests
- job: macOS
pool:
vmImage: macOS-latest
variables:
GitLinkEnabled: false
steps:
- template: azure-pipelines/testfx.yml
parameters:
projectdirectory: src/CodeGeneration.Roslyn.Tests