This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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 yml (#18)
- Loading branch information
1 parent
f8e00a3
commit e392467
Showing
12 changed files
with
112 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
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
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,64 @@ | ||
name: $(Rev:r) | ||
jobs: | ||
- job: Windows | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
steps: | ||
- powershell: | | ||
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0'); | ||
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)"; | ||
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_",""); | ||
$versionSuffixBRANCH = "ci-$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"; | ||
displayName: compute VersionSuffix | ||
- script: dotnet msbuild build.proj | ||
displayName: Test + Build | ||
env: | ||
VersionSuffix: '$(VersionSuffix)' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: 'tests/**/*.trx' | ||
condition: succeededOrFailed() | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: 'bin' | ||
artifactName: 'nupkgs' | ||
- task: NuGetCommand@2 | ||
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))) | ||
inputs: | ||
command: push | ||
nuGetFeedType: external | ||
publishFeedCredentials: 'Jet-MyGet' | ||
versioningScheme: byEnvVar | ||
versionEnvVar: Version | ||
packagesToPush: 'bin/*.nupkg;bin/*.symbols.nupkg' | ||
- 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 msbuild build.proj | ||
displayName: Test + Build | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: 'tests/**/*.trx' | ||
condition: succeededOrFailed() | ||
- job: MacOS | ||
pool: | ||
vmImage: 'macOS-10.13' | ||
steps: | ||
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/" | ||
displayName: Workaround .NET reference assemblies on linux | ||
- script: dotnet msbuild build.proj | ||
displayName: Test + Build | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'VSTest' | ||
testResultsFiles: 'tests/**/*.trx' | ||
condition: succeededOrFailed() |
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 |
---|---|---|
@@ -1,26 +1,25 @@ | ||
<Project ToolsVersion="15.0" DefaultTargets="Build;Test"> | ||
<Project ToolsVersion="15.0" DefaultTargets="Test;Build"> | ||
|
||
<Import Project="Directory.Build.props" /> | ||
|
||
<PropertyGroup> | ||
|
||
<Name>CallPolly</Name> | ||
<Cfg>--configuration Release</Cfg> | ||
|
||
<RepoRootDir>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</RepoRootDir> | ||
<Bin>-o $(RepoRootDir)bin</Bin> | ||
|
||
<BuildNumber Condition="'$(BuildNumber)' != ''">$([System.String]::Format('{0:0000000}',$([MSBuild]::Add($(BuildNumber), 0))))</BuildNumber> | ||
<Suffix Condition=" '$(BuildNumber)' != '' AND '$(PullRequestId)' != ''">--version-suffix CI$(BuildNumber)-pr$(PullRequestId)</Suffix> | ||
<Suffix Condition=" '$(BuildNumber)' != '' AND '$(PullRequestId)' == ''">--version-suffix CI$(BuildNumber)</Suffix> | ||
<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute> | ||
<PackOptions>-o $(ThisDirAbsolute)bin --version-suffix "$(VersionSuffix)"</PackOptions> | ||
<TestOptions>--logger:trx</TestOptions> | ||
|
||
</PropertyGroup> | ||
|
||
<Target Name="Build"> | ||
<Exec Command="dotnet pack src/$(Name) $(Cfg) $(Bin) $(Suffix)" /> | ||
<Exec Command="dotnet pack src/$(Name) $(Cfg) $(PackOptions)" /> | ||
</Target> | ||
|
||
<Target Name="Test"> | ||
<Exec Command="dotnet test tests/$(Name).Tests $(Cfg)" /> | ||
<Exec Command="dotnet test tests/$(Name).Acceptance $(Cfg)" /> | ||
<Exec Command="dotnet test tests/$(Name).Tests $(Cfg) $(TestOptions)" /> | ||
<Exec Command="dotnet test tests/$(Name).Acceptance $(Cfg) $(TestOptions)" /> | ||
</Target> | ||
|
||
</Project> |
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 @@ | ||
& dotnet msbuild build.proj @args |
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
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,3 @@ | ||
{ | ||
"appDomain": "denied" | ||
} |
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
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,3 @@ | ||
{ | ||
"appDomain": "denied" | ||
} |