-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up CI with Azure Pipelines (#86)
Set up CI with Azure Pipelines, replace Travis and Appveyor The OSX CI is not added because the azure agent for OSX doesnt set DOTNET_ROOT and global tools doesnt works, so a test fails ref https://github.com/Microsoft/azure-pipelines-image-generation/issues/531 ref https://github.com/dotnet/cli/issues/9114 The scala tests are ignored too, because sbt is not installed in the azure agent
- Loading branch information
1 parent
67f0c2d
commit 9601fdf
Showing
3 changed files
with
47 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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"; | ||
- 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)' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: 'artifact/test_results/*TestResults.xml' | ||
condition: succeededOrFailed() | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: 'artifact/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 | ||
- 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: 'artifact/test_results/*TestResults.xml' | ||
condition: succeededOrFailed() |