-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
85 lines (81 loc) · 2.74 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
trigger:
- main
variables:
BASE_VERSION: 1.4.2
BUILD_NUMBER: $[counter(format('{0}_{1}', variables['BASE_VERSION'], variables['Build.SourceBranch']), 1)]
PACKAGE_VERSION: $(BASE_VERSION).$(BUILD_NUMBER)
CONFIGURATION: 'Release'
BUILD_PRERELEASE: true
DOTNET_CORE_VERSION: 8.x
PR_NUMBER: $[coalesce(variables['System.PullRequest.PullRequestNumber'], '0')]
jobs:
- job: pack
displayName: Pack
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: Install .NET
inputs:
version: $(DOTNET_CORE_VERSION)
performMultiLevelLookup: true
installationPath: C:\Program Files\dotnet
- pwsh: |
dotnet --info
dotnet tool restore
displayName: Restore .NET tools
- pwsh: |
dotnet cake --target=Pack --configuration="$(CONFIGURATION)" --packageVersion="$(PACKAGE_VERSION)" --prerelease="$(BUILD_PRERELEASE)" --pullrequest="$(PR_NUMBER)"
displayName: Pack
- task: PublishBuildArtifacts@1
displayName: Publish NuGet packages
inputs:
pathToPublish: output
artifactName: nuget
- job: build
displayName: Build everything
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: Install .NET
inputs:
version: $(DOTNET_CORE_VERSION)
performMultiLevelLookup: true
installationPath: C:\Program Files\dotnet
- pwsh: |
dotnet --info
dotnet tool restore
displayName: Restore .NET tools
- pwsh: |
dotnet cake --target=Build --configuration="$(CONFIGURATION)" --packageVersion="$(PACKAGE_VERSION)" --prerelease="$(BUILD_PRERELEASE)" --pullrequest="$(PR_NUMBER)"
displayName: Build
- job: test
displayName: Test
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: Install .NET
inputs:
version: $(DOTNET_CORE_VERSION)
performMultiLevelLookup: true
installationPath: C:\Program Files\dotnet
- pwsh: |
dotnet --info
dotnet tool restore
displayName: Restore .NET tools
- pwsh: |
dotnet cake --target=Test --configuration="$(CONFIGURATION)" --packageVersion="$(PACKAGE_VERSION)" --prerelease="$(BUILD_PRERELEASE)" --pullrequest="$(PR_NUMBER)"
displayName: Run tests
- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
pathToPublish: diff
artifactName: tests-diff
- task: PublishTestResults@2
displayName: Publish test results
condition: always()
inputs:
testResultsFormat: VSTest
testResultsFiles: 'Mono.ApiTools.*.Tests\**\*.trx'