-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bugfix/sf-10
- Loading branch information
Showing
15 changed files
with
489 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# .NET Build | ||
|
||
parameters: | ||
- name: BuildConfiguration | ||
type: string | ||
default: $(BuildConfiguration) | ||
- name: BuildParameters | ||
type: string | ||
- name: BuildPlatform | ||
type: string | ||
steps: | ||
- template: /.github/pipelines/dotnet-initialize.yml@self | ||
parameters: | ||
BuildConfiguration: ${{parameters.BuildConfiguration}} | ||
BuildParameters: Platform="${{parameters.BuildPlatform}}" | ||
- task: DotNetCoreCLI@2 | ||
displayName: dotnet build | ||
inputs: | ||
projects: "**\\*.sln" | ||
arguments: -c ${{parameters.BuildConfiguration}} -p:${{parameters.BuildParameters}} --no-restore |
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,26 @@ | ||
# .NET Build and Tests | ||
|
||
parameters: | ||
- name: BuildConfiguration | ||
type: string | ||
default: $(BuildConfiguration) | ||
- name: BuildParameters | ||
type: string | ||
default: Platform="$(BuildPlatform)" | ||
- name: BuildPlatform | ||
type: string | ||
- name: TestFilter | ||
type: string | ||
default: FullyQualifiedName!~CloudTests | ||
steps: | ||
- template: /.github/pipelines/dotnet-build.yml@self | ||
parameters: | ||
BuildConfiguration: ${{parameters.BuildConfiguration}} | ||
BuildParameters: ${{parameters.BuildParameters}} | ||
BuildPlatform: ${{parameters.BuildPlatform}} | ||
- template: /.github/pipelines/dotnet-tests.yml@self | ||
parameters: | ||
BuildConfiguration: ${{parameters.BuildConfiguration}} | ||
BuildParameters: ${{parameters.BuildParameters}} | ||
BuildPlatform: ${{parameters.BuildPlatform}} | ||
TestFilter: ${{parameters.TestFilter}} |
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,24 @@ | ||
# .Net Initialization | ||
|
||
parameters: | ||
- name: BuildConfiguration | ||
type: string | ||
default: $(BuildConfiguration) | ||
- name: BuildParameters | ||
type: string | ||
default: Platform="$(BuildPlatform)" | ||
steps: | ||
- task: NuGetAuthenticate@1 | ||
displayName: NuGet Authenticate | ||
- task: UseDotNet@2 | ||
displayName: Use .NET SDK from global.json | ||
inputs: | ||
useGlobalJson: true | ||
- task: DotNetCoreCLI@2 | ||
displayName: dotnet restore | ||
inputs: | ||
command: restore | ||
projects: "**\\*.sln" | ||
restoreArguments: /p:Configuration="${{parameters.BuildConfiguration}}" -p:${{parameters.BuildParameters}} | ||
feedRestore: Office | ||
includeNuGetOrg: false |
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,61 @@ | ||
# .NET UnitTests | ||
|
||
parameters: | ||
- name: BuildConfiguration | ||
type: string | ||
default: $(BuildConfiguration) | ||
- name: BuildParameters | ||
type: string | ||
- name: BuildPlatform | ||
type: string | ||
default: $(BuildPlatform) | ||
- name: TestFilter | ||
type: string | ||
default: FullyQualifiedName!~CloudTests | ||
steps: | ||
- task: PowerShell@2 | ||
displayName: run dotnet test (workaround azure-pipelines-tasks/issues/18731) | ||
inputs: | ||
targetType: inline | ||
script: |+ | ||
$buildDirectory = "$(Agent.BuildDirectory)\s\" | ||
Write-Host "Searching for solution file in build directory: $buildDirectory" | ||
# Identify solution file to target | ||
$slnFile = (Get-ChildItem -Path $buildDirectory -Filter "*.sln").Name | ||
Write-Host "Running dotnet test with code coverage enabled" | ||
# Merge all streams into stdout | ||
$result = C:\hostedtoolcache\windows\dotnet\dotnet.exe test $slnFile --collect "Code coverage" --logger trx --results-directory D:\a\_work\_temp -c Release -p:Platform=x64 --no-build --no-restore --filter FullyQualifiedName!~CloudTests --verbosity Detailed *>&1 | ||
# Write output | ||
$output = $result -join [System.Environment]::NewLine | ||
Write-Host $output | ||
if($LASTEXITCODE -eq 0) | ||
{ | ||
# Success | ||
} | ||
else | ||
{ | ||
$LASTEXITCODE = 0 | ||
Write-Warning "Running dotnet test with code coverage enabled failed. Retrying with code coverage collection disabled." | ||
$result = C:\hostedtoolcache\windows\dotnet\dotnet.exe test $slnFile --logger trx --results-directory D:\a\_work\_temp -c Release -p:Platform=x64 --no-build --no-restore --filter FullyQualifiedName!~CloudTests --verbosity Detailed *>&1 | ||
# Write output | ||
$output = $result -join [System.Environment]::NewLine | ||
Write-Host $output | ||
} | ||
- task: PublishTestResults@2 | ||
displayName: Publish Test Results $(Agent.TempDirectory)\**\*.trx | ||
condition: succeededOrFailed() | ||
inputs: | ||
testRunner: VSTest | ||
testResultsFiles: $(Agent.TempDirectory)\**\*.trx | ||
searchFolder: $(Common.TestResultsDirectory) | ||
mergeTestResults: true | ||
platform: ${{parameters.BuildPlatform}} | ||
configuration: ${{parameters.BuildConfiguration}} |
Oops, something went wrong.