Skip to content

Commit

Permalink
Set up CI with Azure Pipelines (#86)
Browse files Browse the repository at this point in the history
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
azure-pipelines[bot] authored and Dave Thomas committed Dec 21, 2018
1 parent 67f0c2d commit 9601fdf
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 56 deletions.
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

47 changes: 47 additions & 0 deletions azure-pipelines.yml
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()

0 comments on commit 9601fdf

Please sign in to comment.