forked from dotnet/Nerdbank.GitVersioning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
148 lines (132 loc) · 4.5 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
trigger:
batch: true
branches:
include: ["master", "develop"]
paths:
exclude: ["doc", "*.md"]
variables:
TreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
BuildPlatform: Any CPU
resources:
containers:
- container: xenial
image: andrewarnott/linux-buildagent
- container: bionic
image: microsoft/dotnet:2.1-sdk-bionic
jobs:
- job: Windows
pool: Hosted VS2017
steps:
- checkout: self
clean: true
submodules: false
- script: |
git config --global user.name ci
git config --global user.email [email protected]
displayName: Configure git commit author for testing
- script: |
dotnet tool install --tool-path . nbgv
.\nbgv cloud -p src -a
displayName: Set build number
- task: DotNetCoreInstaller@0
displayName: Install .NET Core SDK 2.1.500
inputs:
packageType: sdk
version: 2.1.500
- script: dotnet --info
displayName: Show dotnet SDK info
- task: DotNetCoreCLI@2
displayName: Restore NuGet packages
inputs:
command: restore
verbosityRestore: normal # detailed, normal, minimal
projects: src/**/*.sln
feedsToUse: config
nugetConfigPath: src/nuget.config
workingDirectory: src
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
displayName: 'Use Yarn 1.x'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2
displayName: 'Yarn install'
inputs:
ProjectDirectory: 'src/nerdbank-gitversioning.npm'
- script: dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog"
displayName: Build NuGet package and tests
workingDirectory: src
- task: gulp@0
displayName: Build nerdbank-gitversioning NPM package
inputs:
gulpfile: src\nerdbank-gitversioning.npm\gulpfile.js
# Our unit tests use MSBuild 14
# - powershell: Invoke-WebRequest https://download.microsoft.com/download/E/E/D/EEDF18A8-4AED-4CE0-BEBE-70A83094FC5A/BuildTools_Full.exe -OutFile msbuild14.exe
# displayName: Downloading MSBuild 14
# - script: start /wait msbuild14.exe /q /full /log "$(Build.ArtifactStagingDirectory)\build_logs\msbuild14.log"
# displayName: Installing MSBuild 14
# - task: VSTest@2
# displayName: Run tests
# inputs:
# searchFolder: bin/Nerdbank.GitVersioning.Tests
# testFiltercriteria: TestCategory!=FailsOnAzurePipelines
# platform: $(BuildPlatform)
# configuration: $(BuildConfiguration)
# continueOnError: true
- script: dotnet test Nerdbank.GitVersioning.Tests --no-build -c $(BuildConfiguration) --filter "TestCategory!=FailsOnAzurePipelines" --logger "trx;LogFileName=$(Build.ArtifactStagingDirectory)\TestLogs\TestResults.trx"
displayName: Run tests
workingDirectory: src
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: '*.trx'
searchFolder: $(Build.ArtifactStagingDirectory)\TestLogs
buildPlatform: $(BuildPlatform)
buildConfiguration: $(BuildConfiguration)
condition: always()
- task: CopyFiles@1
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)/bin
Contents: |
**\*.nupkg
js\*.tgz
TargetFolder: $(Build.ArtifactStagingDirectory)/deployables
flattenFolders: true
displayName: Collecting deployable artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables
ArtifactName: deployables
ArtifactType: Container
displayName: Publish deployables artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/build_logs
ArtifactName: build_logs
ArtifactType: Container
displayName: Publish build_logs artifacts
condition: succeededOrFailed()
- job: Ubuntu_Xenial
dependsOn: Windows
pool:
vmImage: Ubuntu 16.04
container: xenial
steps:
- bash: sudo apt update && sudo apt-get install -y git
displayName: Install git
- template: azure-pipelines/xplattest-pipeline.yml
- job: Ubuntu_Bionic
dependsOn: Windows
pool:
vmImage: Ubuntu 16.04 # not a bug. we always use this pool, but use containers for the specific version
container: bionic
steps:
- template: azure-pipelines/xplattest-pipeline.yml
- job: macOS
dependsOn: Windows
pool:
vmImage: macOS 10.13
variables:
DOTNET_ROOT: /Users/vsts/.dotnet
steps:
- template: azure-pipelines/xplattest-pipeline.yml