-
-
Notifications
You must be signed in to change notification settings - Fork 137
/
azure-pipelines-ci.yml
74 lines (67 loc) · 1.86 KB
/
azure-pipelines-ci.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
name: '$(Date:yyyyMMdd)$(Rev:.r)'
trigger:
- dev
- master
pr:
autoCancel: false
branches:
include:
- '*'
# pool:
# vmImage: 'windows-latest'
variables:
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
versionSuffix: 'beta-$(Build.BuildNumber)'
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
versionSuffix: ''
jobs:
- job: 'Linux'
displayName: 'Build on Ubuntu'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: |
DnsClientDotNet.sln
arguments: '-c Release'
name: 'Build'
displayName: 'dotnet build'
- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: 'test'
projects: 'test/**/*.csproj'
publishTestResults: true
arguments: '-c Release --no-build --no-restore -f net8.0'
- job: Windows
displayName: 'Build & Test on Windows'
pool:
vmImage: 'windows-latest'
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: |
DnsClientDotNet.sln
arguments: '-c Release'
name: 'Build'
- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: 'test'
projects: 'test/**/*.csproj'
publishTestResults: true
arguments: '-c Release --no-build --no-restore --collect "Code coverage" --settings:.runsettings'
- script: 'dotnet pack src\DnsClient\DnsClient.csproj -c Release --no-build --no-restore --version-suffix "$(versionSuffix)" -v normal -o $(Build.ArtifactStagingDirectory)'
name: 'PackBeta'
displayName: 'dotnet pack'
- task: PublishBuildArtifacts@1
displayName: 'publish'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'beta'