-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathazure-pipelines.yml
60 lines (60 loc) · 2.09 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
name: $(Rev:r)
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: |
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
$versionSuffixPR = "-PR$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)-$buildId";
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_","");
$versionSuffixBRANCH = "-$branchName-$buildId";
$isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/');
$isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne ""
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
- script: dotnet tool restore
displayName: Restore .NET local tools
- script: dotnet pack build.proj -v n
displayName: Create package
env:
VersionSuffix: '$(VersionSuffix)'
- script: dotnet test build.proj -v n
displayName: Run tests
env:
VersionSuffix: '$(VersionSuffix)'
SBT_HOME: '' # disable scala tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'bin/test_results/*TestResults.xml'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'bin/nupkg'
artifactName: 'nupkgs'
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/"
displayName: Workaround .NET reference assemblies on linux
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
- script: dotnet tool restore
displayName: Restore .NET local tools
- script: dotnet pack build.proj -v n
displayName: Create package
- script: dotnet test build.proj -v n
displayName: Run tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'bin/test_results/*TestResults.xml'
condition: succeededOrFailed()