Skip to content

Commit

Permalink
add ob_restore_phase to all steps
Browse files Browse the repository at this point in the history
  • Loading branch information
cssuh committed Jul 15, 2024
1 parent 1047cb6 commit 53d5551
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions azure-pipelines/templates/include-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ steps:
displayName: 'Use defined .NET sdk'
inputs:
useGlobalJson: true
env:
ob_restore_phase: true

- task: CopyFiles@2
displayName: 'Copy nuget.config from: ADO repo to Github repo'
inputs:
Contents: 'nuget.config'
TargetFolder: '$(Build.SourcesDirectory)/sqltoolsservice/'
Overwrite: true
env:
ob_restore_phase: true

- task: PowerShell@2
displayName: 'Save STS commit hash into a build pipeline variable'
Expand All @@ -22,6 +26,8 @@ steps:
echo "STS commit"
echo $sts_commit
Write-Host "##vso[task.setvariable variable=StsSourceVersion;]$sts_commit"
env:
ob_restore_phase: true

- task: PowerShell@2
displayName: 'Add version number to SqlCore project for packaging'
Expand All @@ -34,12 +40,16 @@ steps:
$version = ($(Major)).ToString() + '.' + ($(Minor)).ToString() + '.' + $(Patch) + $(Build.BuildNumber);
$props.Project.PropertyGroup.Version = $version;
$props.Save($projectFile)
env:
ob_restore_phase: true

- task: PowerShell@2
displayName: 'Run script build.ps1'
inputs:
filePath: $(Build.SourcesDirectory)/build.ps1
arguments: '-target=all -mono'
env:
ob_restore_phase: true

- task: DotNetCoreCLI@2
displayName: 'dotnet test test/Microsoft.SqlTools.ServiceLayer.UnitTests'
Expand All @@ -48,6 +58,8 @@ steps:
projects: $(Build.SourcesDirectory)/test/Microsoft.SqlTools.ServiceLayer.UnitTests
testRunTitle: SqlTools.ServiceLayer.UnitTests
arguments: '--configuration Release --collect "XPlat Code Coverage"'
env:
ob_restore_phase: true

- task: DotNetCoreCLI@2
displayName: 'dotnet test test/Microsoft.Kusto.ServiceLayer.UnitTests'
Expand All @@ -56,6 +68,8 @@ steps:
projects: $(Build.SourcesDirectory)/test/Microsoft.Kusto.ServiceLayer.UnitTests
testRunTitle: Kusto.ServiceLayer.UnitTests
arguments: '--configuration Release --collect "XPlat Code Coverage"'
env:
ob_restore_phase: true

- task: DotNetCoreCLI@2
displayName: 'dotnet test test/Microsoft.SqlTools.Authentication.UnitTests'
Expand All @@ -64,14 +78,20 @@ steps:
projects: $(Build.SourcesDirectory)/test/Microsoft.SqlTools.Authentication.UnitTests
testRunTitle: SqlTools.Authentication.UnitTests
arguments: '--configuration Release --collect "XPlat Code Coverage"'
env:
ob_restore_phase: true

- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Agent.TempDirectory)/coverlet/reports -reporttypes:"Cobertura"
displayName: Create Code coverage report
env:
ob_restore_phase: true

- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage report'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Agent.TempDirectory)/coverlet/reports/Cobertura.xml'
env:
ob_restore_phase: true

0 comments on commit 53d5551

Please sign in to comment.