diff --git a/build.proj b/build.proj
index 7014ea77b2..607b687188 100644
--- a/build.proj
+++ b/build.proj
@@ -180,16 +180,16 @@
-
+
-
+
-
+
-
+
diff --git a/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml
new file mode 100644
index 0000000000..cb3790262c
--- /dev/null
+++ b/eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml
@@ -0,0 +1,77 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: poolName
+ type: string
+ default: $(ci_var_defaultPoolName)
+
+ - name: imageOverride
+ type: string
+ default: ADO-MMS22-SQL19
+
+ - name: artifactName
+ type: string
+ default: Artifacts
+
+ - name: platform
+ type: string
+ default: $(Platform)
+
+ - name: configuration
+ type: string
+ default: $(Configuration)
+
+ - name: prebuildSteps
+ type: stepList
+ default: []
+
+jobs:
+- job: build_nugets
+
+ pool:
+ name: ${{parameters.poolName }}
+ demands:
+ - imageOverride -equals ${{ parameters.imageOverride }}
+ - msbuild
+
+ variables:
+ - template: ../../../libraries/ci-build-variables.yml@self
+
+ steps:
+ - ${{ if ne(parameters.prebuildSteps, '') }}:
+ - ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
+
+ - template: ../steps/ci-project-build-step.yml@self
+ parameters:
+ platform: ${{ parameters.platform }}
+ configuration: ${{ parameters.configuration }}
+ operatingSystem: Windows
+ build: all
+
+ - template: ../steps/generate-nuget-package-step.yml@self
+ parameters:
+ NugetPackageVersion: $(NugetPackageVersion)
+ configuration: $(Configuration)
+ nuspecPath: 'tools/specs/Microsoft.Data.SqlClient.nuspec'
+ OutputDirectory: $(packagePath)
+ generateSymbolsPackage: false
+ displayName: 'Generate NuGet package M.D.SqlClient'
+
+ - template: ../steps/generate-nuget-package-step.yml@self
+ parameters:
+ NugetPackageVersion: $(NugetPackageVersion)
+ configuration: $(Configuration)
+ nuspecPath: 'tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec'
+ OutputDirectory: $(packagePath)
+ generateSymbolsPackage: false
+ installNuget: false
+ displayName: 'Generate NuGet package AKV Provider'
+
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: Artifacts'
+ inputs:
+ PathtoPublish: $(packagePath)
+ ArtifactName: ${{ parameters.artifactName }}
diff --git a/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml b/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml
new file mode 100644
index 0000000000..abf67e315a
--- /dev/null
+++ b/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml
@@ -0,0 +1,122 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: upload
+ type: string
+ default: $(ci_var_uploadTestResult)
+
+ - name: poolName
+ type: string
+ default: $(defaultHostedPoolName)
+
+ - name: image
+ type: string
+ default: 'windows-2022'
+
+ - name: downloadArtifactsSteps
+ type: stepList
+ default: []
+
+jobs:
+- job: CodeCoverage
+ displayName: 'Merge Code Coverage'
+
+ variables:
+ uploadTestResult: ${{ parameters.upload }}
+
+ pool:
+ name: '${{ parameters.poolName }}'
+ vmImage: ${{ parameters.image }}
+
+ steps:
+ - ${{if eq(parameters.debug, true)}}:
+ - powershell: |
+ Get-ChildItem env: | Sort-Object Name
+ displayName: 'List Environment Variables [debug]'
+
+ - task: NuGetAuthenticate@1
+ displayName: 'NuGet Authenticate'
+
+ - task: UseDotNet@2
+ displayName: 'Use .NET SDK 7.0.x'
+ inputs:
+ version: 7.0.x
+
+ - ${{ parameters.downloadArtifactsSteps }}
+
+ - ${{ if eq(parameters.debug, true)}}:
+ - powershell: |
+ Get-ChildItem $(Build.SourcesDirectory)\coverageNetFx\ -Recurse -File -Filter *.coverage
+ displayName: 'List coverageNetFx files [debug]'
+
+ - powershell: |
+ Get-ChildItem $(Build.SourcesDirectory)\coverageNetCore\ -Recurse -File -Filter *.coverage
+ displayName: 'List coverageNetCore files [debug]'
+
+ - powershell: |
+ dotnet tool install --global dotnet-coverage
+
+ $files = Get-ChildItem $(Build.SourcesDirectory)\coverageNetFx\ -Recurse -File -Filter *.coverage
+ # echo $files
+ mkdir coverageNetFxXml
+ $counter=0
+ foreach ($file in $files) {
+ & dotnet-coverage merge $file.FullName --output coverageNetFxXml\$((++$counter)).coveragexml --output-format xml
+ }
+
+ $files = Get-ChildItem $(Build.SourcesDirectory)\coverageNetCore\ -Recurse -File -Filter *.coverage
+ # echo $files
+ mkdir coverageNetCoreXml
+ $counter=0
+ foreach ($file in $files) {
+ & dotnet-coverage merge $file.FullName --output coverageNetCoreXml\$((++$counter)).coveragexml --output-format xml
+ }
+
+ # dir coverageNetFxXml\
+ # dir coverageNetCoreXml\
+
+ Write-Host "Clean up disk ... [removing coverageNetFx & coverageNetCore]"
+
+ Remove-Item $(Build.SourcesDirectory)\coverageNetFx -Recurse -Force
+ Remove-Item $(Build.SourcesDirectory)\coverageNetCore -Recurse -Force
+
+ displayName: 'Convert coverage files to xml'
+
+ - ${{ if eq(parameters.debug, true)}}:
+ - powershell: |
+ dir coverageNetFxXml\
+ dir coverageNetCoreXml\
+ displayName: 'List converted files [debug]'
+
+ - script: |
+ dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
+
+ tools\reportgenerator "-reports:coverageNetFxXml\*.coveragexml" "-targetdir:coveragereportNetFx" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\netfx\src;$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\src" "-classfilters:+Microsoft.Data.*"
+
+ tools\reportgenerator "-reports:coverageNetCoreXml\*.coveragexml" "-targetdir:coveragereportAddOns" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.alwaysencrypted.azurekeyvaultprovider.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\add-ons\AzureKeyVaultProvider" "-classfilters:+Microsoft.Data.*"
+
+ tools\reportgenerator "-reports:coverageNetCoreXml\*.coveragexml" "-targetdir:coveragereportNetCore" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\netcore\src;$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\src" "-classfilters:+Microsoft.Data.*"
+ displayName: 'Run ReportGenerator'
+
+ - task: PublishCodeCoverageResults@2
+ displayName: 'Publish code coverage from netcore'
+ inputs:
+ summaryFileLocation: '*\Cobertura.xml'
+
+ - powershell: |
+ #download Codecov CLI
+ $ProgressPreference = 'SilentlyContinue'
+ Invoke-WebRequest -Uri https://cli.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
+
+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetFx\Cobertura.xml" -F netfx
+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetCore\Cobertura.xml" -F netcore
+ ./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportAddOns\Cobertura.xml" -F addons
+ displayName: 'Upload to CodeCov'
+ condition: and(succeeded(), eq(variables['uploadTestResult'], 'true'))
diff --git a/eng/pipelines/common/templates/jobs/ci-run-tests-job.yml b/eng/pipelines/common/templates/jobs/ci-run-tests-job.yml
new file mode 100644
index 0000000000..4aaba4c71e
--- /dev/null
+++ b/eng/pipelines/common/templates/jobs/ci-run-tests-job.yml
@@ -0,0 +1,248 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: poolName
+ type: string
+
+ - name: hostedPool
+ type: boolean
+ default: false
+
+ - name: image
+ type: string
+
+ - name: jobDisplayName
+ type: string
+
+ - name: usemanagedSNI
+ type: boolean
+ default: false
+
+ - name: configProperties
+ type: object
+ default: {} # - key: 'value'
+
+ - name: prebuildSteps
+ type: stepList
+ default: []
+
+ - name: artifactName
+ type: string
+ default: Artifacts
+
+ - name: targetFramework
+ type: string
+
+ - name: enableX86Test
+ type: boolean
+ default: false
+
+ - name: testSet
+ type: string
+
+ - name: publishTestResults
+ type: boolean
+ default: false
+
+ - name: configSqlFor
+ type: string # local, azure, or enclave
+ default: local
+
+ - name: operatingSystem
+ type: string
+ default: ''
+
+ - name: buildType
+ displayName: 'Build Type'
+ default: Project
+ values:
+ - Project
+ - Package
+
+jobs:
+- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}
+
+ pool:
+ name: '${{ parameters.poolName }}'
+ ${{ if eq(parameters.hostedPool, true) }}:
+ vmImage: ${{ parameters.image }}
+ ${{ else }}:
+ demands:
+ - imageOverride -equals ${{ parameters.image }}
+
+ variables:
+ - name: dotnetx86RootPath
+ value: '$(dotnetx86Path)'
+
+ steps:
+ - ${{ if ne(parameters.prebuildSteps, '') }}:
+ - ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
+
+ - ${{ if ne(parameters.configProperties, '{}') }}:
+ - template: ../steps/update-config-file-step.yml@self # update config.json file
+ parameters:
+ debug: ${{ parameters.debug }}
+ UseManagedSNIOnWindows: ${{ parameters.usemanagedSNI }}
+ ${{ if parameters.configProperties.TCPConnectionString }}:
+ TCPConnectionString: ${{ parameters.configProperties.TCPConnectionString }}
+ ${{ if parameters.configProperties.NPConnectionString }}:
+ NPConnectionString: ${{ parameters.configProperties.NPConnectionString }}
+ ${{ if parameters.configProperties.AADAuthorityURL }}:
+ AADAuthorityURL: ${{ parameters.configProperties.AADAuthorityURL }}
+ ${{ if parameters.configProperties.TCPConnectionStringHGSVBS }}:
+ TCPConnectionStringHGSVBS: ${{ parameters.configProperties.TCPConnectionStringHGSVBS }}
+ ${{ if parameters.configProperties.TCPConnectionStringNoneVBS }}:
+ TCPConnectionStringNoneVBS: ${{ parameters.configProperties.TCPConnectionStringNoneVBS }}
+ ${{ if parameters.configProperties.TCPConnectionStringAASSGX }}:
+ TCPConnectionStringAASSGX: ${{ parameters.configProperties.TCPConnectionStringAASSGX }}
+ ${{ if parameters.configProperties.EnclaveEnabled }}:
+ EnclaveEnabled: ${{ eq(parameters.configProperties.EnclaveEnabled, 'true') }}
+ ${{ if parameters.configProperties.TracingEnabled }}:
+ TracingEnabled: ${{ eq(parameters.configProperties.TracingEnabled, 'true') }}
+ ${{ if parameters.configProperties.AADPasswordConnectionString }}:
+ AADPasswordConnectionString: ${{ parameters.configProperties.AADPasswordConnectionString }}
+ ${{ if parameters.configProperties.AADServicePrincipalId }}:
+ AADServicePrincipalId: ${{ parameters.configProperties.AADServicePrincipalId }}
+ ${{ if parameters.configProperties.AADServicePrincipalSecret }}:
+ AADServicePrincipalSecret: ${{ parameters.configProperties.AADServicePrincipalSecret }}
+ ${{ if parameters.configProperties.AzureKeyVaultUrl }}:
+ AzureKeyVaultUrl: ${{ parameters.configProperties.AzureKeyVaultUrl }}
+ ${{ if parameters.configProperties.AzureKeyVaultTenantId }}:
+ AzureKeyVaultTenantId: ${{ parameters.configProperties.AzureKeyVaultTenantId }}
+ ${{ if parameters.configProperties.UserManagedIdentityClientId }}:
+ UserManagedIdentityClientId: ${{ parameters.configProperties.UserManagedIdentityClientId }}
+ ${{ if parameters.configProperties.FileStreamDirectory }}:
+ FileStreamDirectory: ${{ parameters.configProperties.FileStreamDirectory }}
+ ${{ if parameters.configProperties.LocalDbAppName }}:
+ LocalDbAppName: ${{ parameters.configProperties.LocalDbAppName }}
+ ${{ if parameters.configProperties.LocalDbSharedInstanceName }}:
+ LocalDbSharedInstanceName: ${{ parameters.configProperties.LocalDbSharedInstanceName }}
+ ${{ if parameters.configProperties.AliasName }}:
+ AliasName: ${{ parameters.configProperties.AliasName }}
+ ${{ if parameters.configProperties.SupportsIntegratedSecurity }}:
+ SupportsIntegratedSecurity: ${{ eq(parameters.configProperties.SupportsIntegratedSecurity, 'true') }}
+ ${{ if parameters.configProperties.SupportsFileStream }}:
+ SupportsFileStream: ${{ eq(parameters.configProperties.SupportsFileStream, 'true') }}
+ ${{ if parameters.configProperties.DNSCachingConnString }}:
+ DNSCachingConnString: ${{ parameters.configProperties.DNSCachingConnString }}
+ ${{ if parameters.configProperties.DNSCachingServerCR }}:
+ DNSCachingServerCR: ${{ parameters.configProperties.DNSCachingServerCR }}
+ ${{ if parameters.configProperties.DNSCachingServerTR }}:
+ DNSCachingServerTR: ${{ parameters.configProperties.DNSCachingServerTR }}
+ ${{ if parameters.configProperties.EnclaveAzureDatabaseConnString }}:
+ EnclaveAzureDatabaseConnString: ${{ parameters.configProperties.EnclaveAzureDatabaseConnString }}
+ ${{ if parameters.configProperties.IsDNSCachingSupportedCR }}:
+ IsDNSCachingSupportedCR: ${{ eq(parameters.configProperties.IsDNSCachingSupportedCR, 'true') }}
+ ${{ if parameters.configProperties.IsDNSCachingSupportedTR }}:
+ IsDNSCachingSupportedTR: ${{ eq(parameters.configProperties.IsDNSCachingSupportedTR, 'true') }}
+ ${{ if parameters.configProperties.IsAzureSynapse }}:
+ IsAzureSynapse: ${{ eq(parameters.configProperties.IsAzureSynapse, 'true') }}
+ ${{ if parameters.configProperties.ManagedIdentitySupported }}:
+ ManagedIdentitySupported: ${{ eq(parameters.configProperties.ManagedIdentitySupported, 'true') }}
+
+ - ${{ if and(eq(parameters.configSqlFor, 'azure'), eq(parameters.operatingSystem, 'Windows')) }}:
+ - powershell: |
+ # Try to start the SQL Browser service, if it exists
+ $svc_name = "SQLBrowser"
+ if ((Get-Service -Name "$svc_name" -ErrorAction SilentlyContinue) -ne $null) {
+ Get-Service $svc_name | Select-Object -Property Name, StartType, Status
+ Set-Service -StartupType Automatic $svc_name
+ net start $svc_name
+ Get-Service $svc_name | Select-Object -Property Name, StartType, Status
+ }
+
+ displayName: 'Start Sql Browser'
+ condition: eq(variables['Agent.OS'], 'Windows_NT')
+ - ${{ elseif eq(parameters.configSqlFor, 'local') }}:
+ - template: ../steps/configure-sql-server-step.yml@self # configure SQL Server
+ parameters:
+ operatingSystem: ${{ parameters.operatingSystem }}
+ ${{ if parameters.configProperties.instanceName }}:
+ instanceName: ${{ parameters.configProperties.instanceName }}
+ ${{ if parameters.configProperties.user }}:
+ user: ${{ parameters.configProperties.user }}
+ ${{ if parameters.configProperties.saUser }}:
+ saUser: ${{ parameters.configProperties.saUser }}
+ ${{ if parameters.configProperties.password }}:
+ password: ${{ parameters.configProperties.password }}
+ ${{ if parameters.configProperties.SQLRootPath }}:
+ SQLRootPath: ${{ parameters.configProperties.SQLRootPath }}
+ ${{ if parameters.configProperties.x64AliasRegistryPath }}:
+ x64AliasRegistryPath: ${{ parameters.configProperties.x64AliasRegistryPath }}
+ ${{ if parameters.configProperties.x86AliasRegistryPath }}:
+ x86AliasRegistryPath: ${{ parameters.configProperties.x86AliasRegistryPath }}
+ ${{ if parameters.configProperties.SQLAliasName }}:
+ SQLAliasName: ${{ parameters.configProperties.SQLAliasName }}
+ ${{ if parameters.configProperties.SQLAliasPort }}:
+ SQLAliasPort: ${{ parameters.configProperties.SQLAliasPort }}
+ ${{ if parameters.configProperties.targetNetCoreVersion }}:
+ targetNetCoreVersion: ${{ parameters.configProperties.targetNetCoreVersion }}
+ ${{ if parameters.configProperties.databaseName }}:
+ databaseName: ${{ parameters.configProperties.databaseName }}
+ ${{ if parameters.configProperties.enableLocalDB }}:
+ enableLocalDB: ${{ parameters.configProperties.enableLocalDB }}
+ ${{ if parameters.configProperties.localDbAppName }}:
+ LocalDbAppName: ${{ parameters.configProperties.localDbAppName }}
+ ${{ if parameters.configProperties.localDbSharedInstanceName }}:
+ LocalDbSharedInstanceName: ${{ parameters.configProperties.localDbSharedInstanceName }}
+ ${{ if parameters.configProperties.FileStreamDirectory }}:
+ fileStreamDirectory: ${{ parameters.configProperties.FileStreamDirectory }}
+
+ - template: ../steps/build-all-tests-step.yml@self # build tests
+ parameters:
+ targetFramework: ${{ parameters.targetFramework }}
+ referenceType: ${{ parameters.buildType }}
+ testSet: ${{ parameters.testSet }}
+ ${{ if ne(parameters.operatingSystem, 'Windows') }}:
+ OSGroup: Unix
+
+ - template: ../steps/run-all-tests-step.yml@self # run tests
+ parameters:
+ debug: ${{ parameters.debug }}
+ targetFramework: ${{ parameters.targetFramework }}
+ referenceType: ${{ parameters.buildType }}
+ testSet: ${{ parameters.testSet }}
+ operatingSystem: ${{ parameters.operatingSystem }}
+
+ - ${{ if and(eq(parameters.enableX86Test, true), eq(parameters.operatingSystem, 'Windows')) }}: # run x86 tests
+ - powershell: |
+ dotnet --info
+
+ Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
+
+ # install .net x86
+ $version = "LTS"
+ if (!"${{parameters.targetFramework }}".StartsWith("net4"))
+ {
+ $version = "${{parameters.targetFramework }}".Substring(3, "${{parameters.targetFramework }}".Length-3)
+ }
+
+ .\dotnet-install.ps1 -Channel $version -Architecture x86 -InstallDir "$(dotnetx86RootPath)"
+
+ $(dotnetx86RootPath)dotnet.exe --info
+ displayName: 'Install .NET x86 '
+ condition: ne(variables['dotnetx86RootPath'], '')
+
+ - template: ../steps/run-all-tests-step.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ targetFramework: ${{ parameters.targetFramework }}
+ referenceType: ${{ parameters.buildType }}
+ testSet: ${{ parameters.testSet }}
+ msbuildArchitecture: x86
+ dotnetx86RootPath: $(dotnetx86RootPath)
+ operatingSystem: ${{ parameters.operatingSystem }}
+
+ - ${{ if and(eq(parameters.publishTestResults, true), eq(parameters.buildType, 'Project')) }}: # publish test results if build type is project
+ - template: ../steps/publish-test-results-step.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ targetFramework: ${{ parameters.targetFramework }}
+ operatingSystem: ${{ parameters.operatingSystem }}
diff --git a/eng/pipelines/common/templates/stages/ci-run-tests-stage.yml b/eng/pipelines/common/templates/stages/ci-run-tests-stage.yml
new file mode 100644
index 0000000000..536812acf0
--- /dev/null
+++ b/eng/pipelines/common/templates/stages/ci-run-tests-stage.yml
@@ -0,0 +1,102 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: testConfigurations
+ type: object
+
+ - name: dependsOn
+ type: string
+ default: ''
+
+ - name: buildType
+ displayName: 'Build Type'
+ default: Project
+ values:
+ - Project
+ - Package
+
+ - name: prebuildSteps
+ type: stepList
+ default: []
+
+ - name: postTestJobs
+ type: jobList
+ default: []
+
+stages:
+- ${{ each config in parameters.testConfigurations }}:
+ - ${{ each image in config.value.images }}:
+ - stage: ${{ image.key }}
+ ${{ if ne(parameters.dependsOn, '') }}:
+ dependsOn: ${{ parameters.dependsOn }}
+ ${{ else }}:
+ dependsOn: []
+ jobs:
+ - ${{ each targetFramework in config.value.TargetFrameworks }}:
+ - ${{ each platform in config.value.buildPlatforms }}:
+ - ${{ each testSet in config.value.TestSets }}:
+ - ${{ if contains(targetFramework, 'net4') }}: # .NET Framework
+ - template: ../jobs/ci-run-tests-job.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ buildType: ${{ parameters.buildType }}
+ poolName: ${{ config.value.pool }}
+ hostedPool: ${{ eq(config.value.hostedPool, true) }}
+ image: ${{ image.value }}
+ jobDisplayName: ${{ format('{0}_{1}_{2}', replace(targetFramework, '.', '_'), platform, testSet) }}
+ configProperties: ${{ config.value.configProperties }}
+ prebuildSteps: ${{ parameters.prebuildSteps }}
+ targetFramework: ${{ targetFramework }}
+ testSet: ${{ testSet }}
+ ${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
+ ${{ if eq(codeCoveTF, targetFramework) }}:
+ publishTestResults: true
+ configSqlFor: ${{ config.value.configSqlFor }}
+ operatingSystem: ${{ config.value.operatingSystem }}
+ ${{if ne(config.value.configProperties, '{}') }}:
+ ${{ each x86TF in config.value.configProperties.x86TestTargetFrameworks }}:
+ ${{ if eq(x86TF, targetFramework) }}:
+ enableX86Test: true
+ - ${{ else }}: # .NET
+ - ${{ each useManagedSNI in config.value.useManagedSNI }}:
+ - template: ../jobs/ci-run-tests-job.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ buildType: ${{ parameters.buildType }}
+ poolName: ${{ config.value.pool }}
+ hostedPool: ${{ eq(config.value.hostedPool, true) }}
+ image: ${{ image.value }}
+ ${{if eq(usemanagedSNI, 'true') }}:
+ jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'ManagedSNI', testSet) }}
+ ${{ else }}:
+ jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'NativeSNI', testSet) }}
+ configProperties: ${{ config.value.configProperties }}
+ useManagedSNI: ${{ useManagedSNI }}
+ prebuildSteps: ${{ parameters.prebuildSteps }}
+ targetFramework: ${{ targetFramework }}
+ testSet: ${{ testSet }}
+ ${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
+ ${{ if eq(codeCoveTF, targetFramework) }}:
+ publishTestResults: true
+ configSqlFor: ${{ config.value.configSqlFor }}
+ operatingSystem: ${{ config.value.operatingSystem }}
+ ${{if and(eq(usemanagedSNI, false), ne(config.value.configProperties, '{}')) }}:
+ ${{ each x86TF in config.value.configProperties.x86TestTargetFrameworks }}:
+ ${{ if eq(x86TF, targetFramework) }}:
+ enableX86Test: true
+
+- ${{ if ne(length(parameters.postTestJobs), 0) }}:
+ - stage: Post_Test
+ displayName: 'Post Test Jobs'
+ dependsOn:
+ - ${{ each config in parameters.testConfigurations }}:
+ - ${{ each image in config.value.images }}:
+ - ${{ image.key }}
+ jobs: ${{ parameters.postTestJobs }}
diff --git a/eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml b/eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
index cac036f112..24be776959 100644
--- a/eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
+++ b/eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
@@ -35,7 +35,7 @@ steps:
displayName: 'BuildAllConfigurations using build.proj'
inputs:
solution: '**/build.proj'
- configuration: '${{parameters.Configuration }}'
+ configuration: '${{parameters.Configuration }}'
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAllConfigurations -p:GenerateNuget=false -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'
- ${{ if eq(parameters.product, 'AKV') }}:
@@ -43,12 +43,12 @@ steps:
displayName: 'BuildAKVNetFx using build.proj'
inputs:
solution: '**/build.proj'
- configuration: '$(Configuration)'
+ configuration: '${{parameters.Configuration }}'
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAKVNetFx -p:NugetPackageVersion=${{parameters.nugetPackageRefVersion }} -p:ReferenceType=Package -p:SignAssembly=true -p:AssemblyOriginatorKeyFile=$(Agent.TempDirectory)\netfxKeypair.snk'
- task: MSBuild@1
displayName: 'BuildAKVNetCoreAllOS using build.proj'
inputs:
solution: '**/build.proj'
- configuration: '$(Configuration)'
+ configuration: '${{parameters.Configuration }}'
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAKVNetCoreAllOS -p:NugetPackageVersion=${{parameters.nugetPackageRefVersion }} -p:ReferenceType=Package -p:SignAssembly=true -p:AssemblyOriginatorKeyFile=$(Agent.TempDirectory)\netfxKeypair.snk'
diff --git a/eng/pipelines/common/templates/steps/build-all-tests-step.yml b/eng/pipelines/common/templates/steps/build-all-tests-step.yml
new file mode 100644
index 0000000000..826be1df8b
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/build-all-tests-step.yml
@@ -0,0 +1,75 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: targetFramework
+ type: string
+
+ - name: nugetPackageVersion
+ type: string
+ default: $(NugetPackageVersion)
+
+ - name: platform
+ type: string
+ default: $(Platform)
+
+ - name: configuration
+ type: string
+ default: '$(Configuration)'
+
+ - name: referenceType
+ default: Package
+ values:
+ - Project
+ - Package
+
+ - name: OSGroup
+ type: string
+ default: ''
+
+ - name: testSet
+ type: string
+
+steps:
+- ${{ if contains(parameters.targetFramework, 'net4') }}: # .NET Framework
+ - task: MSBuild@1
+ displayName: 'Build Tests NetFx'
+ inputs:
+ solution: build.proj
+ platform: '${{parameters.platform }}'
+ configuration: '${{parameters.configuration }}'
+ msbuildArguments: '-t:BuildTestsNetFx -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }}'
+
+# - ${{else if contains(parameters.targetFramework, 'netstandard')}}: # .NET Standard
+# - task: MSBuild@1
+# displayName: 'Build Tests NetStandard'
+# inputs:
+# solution: build.proj
+# platform: '${{parameters.platform }}'
+# configuration: '${{parameters.configuration }}'
+# msbuildArguments: '-t:BuildTestsNetCore -p:ReferenceType=NetStandard -p:TargetNetStandardVersion=${{parameters.targetNetStandardVersion }} -p:TF=${{parameters.targetFramework }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }}'
+# condition: and(succeeded(), not(startsWith(variables['TF'], 'net4')), startsWith(variables['TargetNetStandardVersion'], 'netstandard'))
+
+- ${{elseif eq(parameters.OSGroup, '')}}: # .NET on Windows
+ - task: MSBuild@1
+ displayName: 'Build Tests NetCore [Win]'
+ inputs:
+ solution: build.proj
+ platform: '${{parameters.platform }}'
+ configuration: '${{parameters.configuration }}'
+ msbuildArguments: '-t:BuildTestsNetCore -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }}'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+
+- ${{ else }}: # .NET on Unix
+ - task: DotNetCoreCLI@2
+ displayName: 'Build Tests NetCore [Non-Win]'
+ inputs:
+ command: custom
+ projects: build.proj
+ custom: msbuild
+ arguments: '-t:BuildTestsNetCore -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }} -p:OSGroup=${{parameters.OSGroup }} -p:platform=${{parameters.platform }} -p:Configuration=${{parameters.configuration }}'
+ verbosityRestore: Detailed
+ verbosityPack: Detailed
+ condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
diff --git a/eng/pipelines/common/templates/steps/ci-prebuild-step.yml b/eng/pipelines/common/templates/steps/ci-prebuild-step.yml
new file mode 100644
index 0000000000..b6f1ef56fe
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/ci-prebuild-step.yml
@@ -0,0 +1,43 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: artifactName
+ type: string
+ default: Artifacts
+
+ - name: buildType
+ displayName: 'Build Type'
+ default: Project
+ values:
+ - Project
+ - Package
+
+steps:
+- ${{if eq(parameters.debug, true)}}:
+ - powershell: |
+ Get-ChildItem env: | Sort-Object Name
+ displayName: 'List Environment Variables [debug]'
+
+- ${{if eq(parameters.buildType, 'Package')}}:
+ - task: DownloadPipelineArtifact@2
+ displayName: 'Download NuGet Package'
+ inputs:
+ buildType: current
+ artifact: ${{parameters.artifactName }}
+ patterns: '**/*.nupkg'
+ targetPath: $(Pipeline.Workspace)/${{parameters.artifactName }}
+
+ - template: update-nuget-config-local-feed-step.yml@self
+ parameters:
+ downloadedNugetPath: $(Pipeline.Workspace)\${{parameters.artifactName }}
+ debug: ${{ parameters.debug }}
+
+- ${{ else }}: # project
+ - template: ci-project-build-step.yml@self
diff --git a/eng/pipelines/common/templates/steps/ci-project-build-step.yml b/eng/pipelines/common/templates/steps/ci-project-build-step.yml
new file mode 100644
index 0000000000..8ae630e1a5
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/ci-project-build-step.yml
@@ -0,0 +1,90 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: platform
+ type: string
+ default: $(Platform)
+
+ - name: configuration
+ type: string
+ default: $(Configuration)
+
+ - name: buildNumber
+ type: string
+ default: $(BuildNumber)
+
+ - name: operatingSystem
+ type: string
+ default: deferedToRuntime
+ values:
+ - Windows
+ - Linux
+ - MacOS
+ - deferedToRuntime
+
+ - name: build
+ type: string
+ default: MDS
+ values:
+ - MDS
+ - AKV
+ - all
+
+steps:
+- ${{ if or(eq(parameters.operatingSystem, 'Windows'), eq(parameters.operatingSystem, 'deferedToRuntime')) }}:
+ - ${{ if or(eq(parameters.build, 'MDS'), eq(parameters.build, 'all')) }}:
+ - task: MSBuild@1
+ displayName: 'Restore nugets [Win]'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: x64
+ msbuildArguments: '-t:restore'
+
+ - task: MSBuild@1
+ displayName: 'Build Driver [Win]'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: x64
+ platform: '${{ parameters.platform }}'
+ configuration: '${{ parameters.configuration }}'
+ msbuildArguments: '-t:BuildAllConfigurations -p:GenerateNuGet=false -p:BuildNumber=${{ parameters.buildNumber }}'
+ clean: true
+
+ - ${{ if or(eq(parameters.build, 'AKV'), eq(parameters.build, 'all')) }}:
+ - task: MSBuild@1
+ displayName: 'Build AKV Provider NetFx [Win]'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: x64
+ platform: '${{ parameters.platform }}'
+ configuration: '${{ parameters.configuration }}'
+ msbuildArguments: '-t:BuildAKVNetFx -p:BuildNumber=${{ parameters.buildNumber }}'
+
+ - task: MSBuild@1
+ displayName: 'Build AKV Provider NetCore All OS [Win]'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: x64
+ platform: '${{ parameters.platform }}'
+ configuration: '${{ parameters.configuration }}'
+ msbuildArguments: '-t:BuildAKVNetCoreAllOS -p:BuildNumber=${{ parameters.buildNumber }}'
+
+- ${{ if or(eq(parameters.operatingSystem, 'Linux'), eq(parameters.operatingSystem, 'MacOS'), eq(parameters.operatingSystem, 'deferedToRuntime')) }}:
+ - task: DotNetCoreCLI@2
+ displayName: 'Build Driver [non-Win]'
+ condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
+ inputs:
+ command: custom
+ projects: build.proj
+ custom: msbuild
+ arguments: '-t:BuildAll -p:TestEnabled=true -p:GenerateDocumentationFile=false -p:configuration=${{ parameters.configuration }}'
+ verbosityRestore: Detailed
+ verbosityPack: Detailed
+ retryCountOnTaskFailure: 1
diff --git a/eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml b/eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml
new file mode 100644
index 0000000000..2976c83939
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml
@@ -0,0 +1,64 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: password
+ type: string
+ default: $(password)
+
+ - name: targetNetCoreVersion
+ type: string
+ default: $(MainTargetNetCoreVersion)
+
+ - name: condition
+ type: string
+ default: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
+
+steps:
+# Linux only steps
+- bash: |
+ echo ${{parameters.targetNetCoreVersion }}
+
+ sudo systemctl stop mssql-server
+
+ # Password for the SA user (required)
+ MSSQL_SA_PW=${{parameters.password }}
+ if [ "$MSSQL_SA_PW" = "generated_placeholder" ]; then
+ exit 0
+ fi
+
+ # Product ID of the version of SQL server you're installing
+ # Must be evaluation, developer, express, web, standard, enterprise, or your 25 digit product key
+ MSSQL_PID='enterprise'
+
+ echo Running mssql-conf setup...
+ sudo MSSQL_SA_PASSWORD=$MSSQL_SA_PW\
+ MSSQL_PID=$MSSQL_PID \
+ /opt/mssql/bin/mssql-conf -n setup accept-eula
+
+ # Connect to server and get the version:
+ counter=1
+ errstatus=1
+ while [ $counter -le 5 ] && [ $errstatus = 1 ]
+ do
+ echo Waiting for SQL Server to start...
+ sleep 3s
+ /opt/mssql-tools/bin/sqlcmd \
+ -S localhost \
+ -U SA \
+ -P $MSSQL_SA_PW\
+ -Q "SELECT @@VERSION" 2>/dev/null
+ errstatus=$?
+ ((counter++))
+ done
+
+ # Display error if connection failed:
+ if [ $errstatus = 1 ]
+ then
+ echo Cannot connect to SQL Server, installation aborted
+ exit $errstatus
+ fi
+ displayName: 'Configure SQL Server [Linux]'
+ condition: ${{parameters.condition }}
diff --git a/eng/pipelines/common/templates/steps/configure-sql-server-step.yml b/eng/pipelines/common/templates/steps/configure-sql-server-step.yml
new file mode 100644
index 0000000000..b3ca39125f
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/configure-sql-server-step.yml
@@ -0,0 +1,110 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+# Windows only parameters
+ - name: instanceName
+ type: string
+ default: MSSQLSERVER
+
+ - name: user
+ type: string
+ default: $(user)
+
+ - name: saUser
+ type: string
+ default: $(saUser)
+
+ - name: SQLRootPath
+ type: string
+ default: ''
+
+ - name: fileStreamDirectory
+ type: string
+ default: ''
+
+ - name: x64AliasRegistryPath
+ type: string
+ default: $(x64AliasRegistryPath)
+
+ - name: x86AliasRegistryPath
+ type: string
+ default: $(x86AliasRegistryPath)
+
+ - name: SQLAliasName
+ type: string
+ default: $(SQLAliasName)
+
+ - name: SQLAliasPort
+ type: string
+ default: $(SQLAliasPort)
+
+ - name: enableLocalDB
+ type: boolean
+ default: false
+
+ - name: localDbAppName
+ type: string
+ default: $(LocalDbAppName)
+
+ - name: localDbSharedInstanceName
+ type: string
+ default: $(LocalDbSharedInstanceName)
+
+# Common parameters
+ - name: password
+ type: string
+ default: $(password)
+
+ - name: targetNetCoreVersion
+ type: string
+ default: $(MainTargetNetCoreVersion)
+
+ - name: databaseName
+ type: string
+ default: Northwind
+
+ - name: operatingSystem
+ type: string
+
+steps:
+- ${{ if eq(parameters.operatingSystem, 'Windows') }}:
+ # windows only steps
+ - template: configure-sql-server-win-step.yml@self
+ parameters:
+ instanceName: ${{parameters.instanceName}}
+ user: ${{parameters.user}}
+ saUser: ${{parameters.saUser}}
+ SQLRootPath: ${{parameters.SQLRootPath}}
+ fileStreamDirectory: ${{parameters.fileStreamDirectory}}
+ x64AliasRegistryPath: ${{parameters.x64AliasRegistryPath}}
+ x86AliasRegistryPath: ${{parameters.x86AliasRegistryPath}}
+ SQLAliasName: ${{parameters.SQLAliasName}}
+ SQLAliasPort: ${{parameters.SQLAliasPort}}
+ enableLocalDB: ${{parameters.enableLocalDB}}
+ localDbAppName: ${{parameters.localDbAppName}}
+ localDbSharedInstanceName: ${{parameters.localDbSharedInstanceName}}
+ password: ${{parameters.password}}
+
+- ${{ elseif eq(parameters.operatingSystem, 'Linux') }}:
+ # Linux only steps
+ - template: configure-sql-server-linux-step.yml@self
+ parameters:
+ password: ${{parameters.password}}
+ targetNetCoreVersion: ${{parameters.targetNetCoreVersion}}
+
+# Common steps
+- task: DotNetCoreCLI@2
+ displayName: 'Build Ext Utilities'
+ inputs:
+ arguments: '-f ${{parameters.targetNetCoreVersion }}'
+ workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities
+
+- task: DotNetCoreCLI@2
+ displayName: 'Create Test Database ${{parameters.databaseName }}'
+ inputs:
+ command: run
+ arguments: '-f ${{parameters.targetNetCoreVersion }} -- "CreateDatabase" ${{parameters.databaseName }} '
+ workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities
diff --git a/eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml b/eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml
new file mode 100644
index 0000000000..330ee7eebb
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml
@@ -0,0 +1,236 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+# Windows only parameters
+ - name: instanceName
+ type: string
+ default: MSSQLSERVER
+
+ - name: user
+ type: string
+ default: $(user)
+
+ - name: saUser
+ type: string
+ default: $(saUser)
+
+ - name: SQLRootPath
+ type: string
+ default: ''
+
+ - name: fileStreamDirectory
+ type: string
+ default: ''
+
+ - name: x64AliasRegistryPath
+ type: string
+ default: $(x64AliasRegistryPath)
+
+ - name: x86AliasRegistryPath
+ type: string
+ default: $(x86AliasRegistryPath)
+
+ - name: SQLAliasName
+ type: string
+ default: $(SQLAliasName)
+
+ - name: SQLAliasPort
+ type: string
+ default: $(SQLAliasPort)
+
+ - name: enableLocalDB
+ type: boolean
+ default: false
+
+ - name: localDbAppName
+ type: string
+ default: $(LocalDbAppName)
+
+ - name: localDbSharedInstanceName
+ type: string
+ default: $(LocalDbSharedInstanceName)
+
+# Common parameters
+ - name: password
+ type: string
+ default: $(password)
+
+ - name: condition
+ type: string
+ default: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+
+steps:
+# windows only steps
+- powershell: |
+ try
+ {
+ # enable TCP
+ Import-Module "sqlps"
+ $smo = 'Microsoft.SqlServer.Management.Smo.'
+ $wmi = new-object ($smo + 'Wmi.ManagedComputer').
+ # List the object properties, including the instance names.
+ $Wmi
+
+ # Enable the TCP protocol on the default instance.
+ $Tcp = $wmi.GetSmoObject("ManagedComputer[@Name='$env:COMPUTERNAME']/ ServerInstance[@Name='${{parameters.instanceName }}']/ServerProtocol[@Name='Tcp']")
+ $Tcp.IsEnabled = $true
+ $Tcp.Alter()
+
+ # Enable the NP protocol on the default instance.
+ $Np = $wmi.GetSmoObject("ManagedComputer[@Name='$env:COMPUTERNAME']/ ServerInstance[@Name='${{parameters.instanceName }}']/ServerProtocol[@Name='Np']")
+ $Np.IsEnabled = $true
+ $Np.Alter()
+
+ $Tcp
+ }
+ catch
+ {
+ $error[0] | format-list -force
+ throw
+ }
+
+ New-NetFirewallRule -DisplayName "SQL TCP Ports" -Direction Inbound –Protocol TCP –LocalPort 1433 -Action allow
+ $sqlSrvPath = (Get-WmiObject win32_service | ?{$_.DisplayName -eq 'SQL Server (${{parameters.instanceName }})'} | select @{Name="Path"; Expression={$_.PathName.split('"')[1]}}).Path
+ New-NetFirewallRule -DisplayName "sqlservr.exe" -Program "$sqlSrvPath"
+ displayName: 'Enable TCP, NP & Firewall [Win]'
+ condition: ${{parameters.condition }}
+ retryCountOnTaskFailure: 2
+
+- powershell: |
+ $password = "${{parameters.password }}"
+ if ( "generated_placeholder" -eq $password )
+ {
+ $password = [guid]::NewGuid().ToString()
+ }
+
+ $machineName = $env:COMPUTERNAME
+
+ if ("${{parameters.instanceName }}" -ne "MSSQLSERVER"){
+ $machineName += "\${{parameters.instanceName }}"
+ }
+
+ Write-Host $machineName
+ Import-Module "sqlps"
+ Invoke-Sqlcmd -ServerInstance "$machineName" @"
+ CREATE LOGIN [${{parameters.user }}] WITH PASSWORD=N'$password',
+ DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;
+ CREATE USER [${{parameters.user }}] FROM LOGIN [${{parameters.user }}];
+ ALTER SERVER ROLE [sysadmin] ADD MEMBER [${{parameters.user }}];
+ ALTER LOGIN [${{parameters.saUser }}] ENABLE;
+ ALTER LOGIN [${{parameters.saUser }}] WITH PASSWORD = '$password';
+ "@
+ displayName: 'Create SQL user [Win]'
+ condition: ${{parameters.condition }}
+ env:
+ SQL_USER: ${{parameters.user }}
+ SQL_PASSWD: ${{parameters.password }}
+
+- ${{ if ne(parameters.SQLRootPath, '') }}:
+ - powershell: |
+ #Enable FileStream
+ $instance = "${{parameters.instanceName }}"
+ $wmi = Get-WmiObject -Namespace "${{parameters.SQLRootPath }}" -Class FilestreamSettings | where {$_.InstanceName -eq $instance}
+ $wmi.EnableFilestream(3, $instance)
+
+ $machineName = $env:COMPUTERNAME
+
+ if ("${{parameters.instanceName }}" -ne "MSSQLSERVER"){
+ $machineName += "\${{parameters.instanceName }}"
+ }
+
+ #Change the access level for FileStream for SQLServer
+ Set-ExecutionPolicy Unrestricted
+ Import-Module "sqlps"
+ Invoke-Sqlcmd -ServerInstance "$machineName" @"
+ EXEC sp_configure filestream_access_level, 2;
+ RECONFIGURE;
+ "@
+ displayName: 'Enable FileStream [Win]'
+ condition: ${{parameters.condition }}
+ env:
+ SQL_USER: ${{parameters.user }}
+ SQL_PASSWD: ${{parameters.password }}
+
+- ${{ if ne(parameters.FileStreamDirectory, '') }}:
+ - powershell: |
+ New-Item -Path ${{ parameters.fileStreamDirectory }} -ItemType Directory
+ displayName: 'Create FileStreamFolder'
+ retryCountOnTaskFailure: 1
+ condition: ${{parameters.condition }}
+ continueOnError: true
+
+- powershell: |
+ $SQLServerName = ("{0}" -f [System.Net.Dns]::GetHostByName($env:computerName).HostName)
+ Write-Host FQDN is: $SQLServerName
+
+ if ((Test-Path -Path ${{parameters.x64AliasRegistryPath }}) -ne $true) {
+ New-Item ${{parameters.x64AliasRegistryPath }}
+ }
+
+ if ((Test-Path -Path ${{parameters.x86AliasRegistryPath }}) -ne $true) {
+ New-Item ${{parameters.x86AliasRegistryPath }}
+ }
+
+ $TCPAliasName = "DBMSSOCN, $SQLServerName, ${{parameters.SQLAliasPort }}"
+
+ New-ItemProperty -Path ${{parameters.x86AliasRegistryPath }} -Name ${{parameters.SQLAliasName }} -PropertyType string -Value $TCPAliasName
+ New-ItemProperty -Path ${{parameters.x64AliasRegistryPath }} -Name ${{parameters.SQLAliasName }} -PropertyType string -Value $TCPAliasName
+ displayName: 'Setup SQL Alias [Win]'
+ condition: ${{parameters.condition }}
+
+- powershell: |
+ # You need to restart SQL Server for the change to persist
+ # -Force takes care of any dependent services, like SQL Agent.
+ # Note: if the instance is named, replace MSSQLSERVER with MSSQL$ followed by
+ # the name of the instance (e.g. MSSQL$MYINSTANCE)
+
+ $serviceName = "${{parameters.instanceName }}"
+ $InstancePrefix = 'MSSQL$'
+
+ if ( "${{parameters.instanceName }}" -ne "MSSQLSERVER" )
+ {
+ $serviceName = $InstancePrefix+"${{parameters.instanceName }}"
+ }
+
+ Restart-Service -Name "$serviceName" -Force
+
+ displayName: 'Restart SQL Server [Win]'
+ condition: ${{parameters.condition }}
+
+- powershell: |
+ $arrService = Get-Service -Name "SQLBrowser"
+ $arrService
+
+ if ($arrService.Status -eq 'Stopped') {
+ Write-Host 'Attempt to run the service ...'
+ # updating the startup type to make sure it's not disabled
+ Set-Service -StartupType Automatic $arrService.Name
+ $arrService.Start()
+
+ $arrService.WaitForStatus('Running', '00:00:30')
+ if ($arrService.Status -eq 'Running') {
+ $arrService
+ } else {
+ Write-Error 'Timed out waiting for service to start.'
+ }
+ }
+ displayName: 'Start Sql Server Browser [Win]'
+ condition: ${{parameters.condition }}
+
+- ${{ if parameters.enableLocalDB }}:
+ - powershell: |
+ #script to enable local db
+
+ SqlLocalDB info
+ #SqlLocalDB create ${{parameters.localDbAppName }}
+ SqlLocalDB info ${{parameters.localDbAppName }}
+ SqlLocalDB share ${{parameters.localDbAppName }} ${{parameters.LocalDbSharedInstanceName }}
+ SqlLocalDB start ${{parameters.localDbAppName }}
+ SqlLocalDB info ${{parameters.localDbAppName }}
+
+ sqlcmd -S "(localdb)\.\${{parameters.LocalDbSharedInstanceName }}" -q "SELECT @@VERSION"
+ displayName: 'Enable LocalDB [Win]'
+ condition: ${{parameters.condition }}
diff --git a/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml b/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml
index d97229089a..4e32f989c3 100644
--- a/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml
+++ b/eng/pipelines/common/templates/steps/generate-nuget-package-step.yml
@@ -19,7 +19,19 @@ parameters:
- name: Configuration
type: string
default: '$(Configuration)'
-
+
+ - name: generateSymbolsPackage
+ type: boolean
+ default: true
+
+ - name: displayName
+ type: string
+ default: 'NuGet pack with snupkg'
+
+ - name: installNuget
+ type: boolean
+ default: true
+
- name: referenceType
default: project
values:
@@ -27,16 +39,22 @@ parameters:
- package
steps:
-- task: NuGetToolInstaller@1
- displayName: 'Install Latest Nuget'
- inputs:
- checkLatest: true
+- ${{ if parameters.installNuget }}:
+ - task: NuGetToolInstaller@1
+ displayName: 'Install Latest Nuget'
+ inputs:
+ checkLatest: true
+
- powershell: |
$Commit=git rev-parse HEAD
Write-Host "##vso[task.setvariable variable=CommitHead;]$Commit"
displayName: CommitHead
+
- task: NuGetCommand@2
- displayName: 'NuGet pack with snupkg'
+ displayName: ${{parameters.displayName }}
inputs:
command: custom
- arguments: 'pack -Symbols -SymbolPackageFormat snupkg ${{parameters.nuspecPath}} -Version ${{parameters.NugetPackageVersion}} -OutputDirectory ${{parameters.OutputDirectory}} -properties "COMMITID=$(CommitHead);Configuration=${{parameters.Configuration}};ReferenceType=${{parameters.referenceType}}"'
+ ${{ if parameters.generateSymbolsPackage }}:
+ arguments: 'pack -Symbols -SymbolPackageFormat snupkg ${{parameters.nuspecPath}} -Version ${{parameters.NugetPackageVersion}} -OutputDirectory ${{parameters.OutputDirectory}} -properties "COMMITID=$(CommitHead);Configuration=${{parameters.Configuration}};ReferenceType=${{parameters.referenceType}}"'
+ ${{else }}:
+ arguments: 'pack ${{parameters.nuspecPath}} -Version ${{parameters.NugetPackageVersion}} -OutputDirectory ${{parameters.OutputDirectory}} -properties "COMMITID=$(CommitHead);Configuration=${{parameters.Configuration}};ReferenceType=${{parameters.referenceType}}"'
diff --git a/eng/pipelines/common/templates/steps/publish-test-results-step.yml b/eng/pipelines/common/templates/steps/publish-test-results-step.yml
new file mode 100644
index 0000000000..791a8201b2
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/publish-test-results-step.yml
@@ -0,0 +1,59 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: targetFramework
+ type: string
+
+ - name: platform
+ type: string
+ default: $(Platform)
+
+ - name: configuration
+ type: string
+ default: '$(Configuration)'
+
+ - name: operatingSystem
+ type: string
+
+steps:
+- task: PublishTestResults@2
+ displayName: 'Publish Test Results'
+ inputs:
+ testResultsFormat: VSTest
+ mergeTestResults: true
+ buildPlatform: '${{parameters.platform }}'
+ buildConfiguration: '${{parameters.configuration }}'
+ ${{ if eq(parameters.operatingSystem, 'Windows') }}:
+ testResultsFiles: 'TestResults/*.trx'
+ testRunTitle: 'Windows Tests'
+ ${{ else }}:
+ testResultsFiles: |
+ TestResults/*.trx
+ TestResults/**/*.coverage
+ testRunTitle: 'Linux Tests'
+
+- powershell: |
+ cd TestResults
+ $TF="${{parameters.targetFramework }}"
+ Get-ChildItem -Filter “*.coverage” -Recurse | Rename-Item -NewName {"$TF" + $_.name}
+ displayName: 'Rename coverage files'
+
+- ${{ if eq(parameters.debug, true)}}:
+ - powershell: |
+ cd TestResults
+ Get-ChildItem -Filter “*.coverage” -Recurse
+ displayName: 'List test result coverage files [debug]'
+
+- task: PublishPipelineArtifact@1
+ displayName: 'Publish Pipeline Artifact'
+ inputs:
+ targetPath: TestResults
+ artifact: '${{parameters.targetFramework }}WinAz$(System.JobId)'
+ condition: succeededOrFailed()
diff --git a/eng/pipelines/common/templates/steps/run-all-tests-step.yml b/eng/pipelines/common/templates/steps/run-all-tests-step.yml
new file mode 100644
index 0000000000..f0eb2eff66
--- /dev/null
+++ b/eng/pipelines/common/templates/steps/run-all-tests-step.yml
@@ -0,0 +1,107 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters:
+ - name: debug
+ type: boolean
+ default: false
+
+ - name: targetFramework
+ type: string
+
+ - name: nugetPackageVersion
+ type: string
+ default: $(NugetPackageVersion)
+
+ - name: platform
+ type: string
+ default: $(Platform)
+
+ - name: configuration
+ type: string
+ default: '$(Configuration)'
+
+ - name: referenceType
+ default: Package
+ values:
+ - Project
+ - Package
+
+ - name: testSet
+ type: string
+
+ - name: msbuildArchitecture
+ default: x64
+ values:
+ - x64
+ - x86
+
+ - name: dotnetx86RootPath # full path to the x86 dotnet root folder with trailing slash
+ type: string
+ default: ''
+
+ - name: operatingSystem
+ type: string
+ default: 'Windows'
+
+steps:
+- ${{ if parameters.debug }}:
+ - powershell: 'dotnet sdk check'
+ displayName: '.NET sdk check [debug]'
+ condition: succeededOrFailed()
+
+- ${{if eq(parameters.operatingSystem, 'Windows')}}:
+ - task: MSBuild@1
+ displayName: 'Run Functional Tests ${{parameters.msbuildArchitecture }}'
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: ${{parameters.msbuildArchitecture }}
+ platform: '${{parameters.platform }}'
+ configuration: '${{parameters.configuration }}'
+ ${{ if eq(parameters.msbuildArchitecture, 'x64') }}:
+ msbuildArguments: '-t:RunFunctionalTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }}'
+ ${{ else }}: # x86
+ msbuildArguments: '-t:RunFunctionalTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }} -p:DotnetPath=${{parameters.dotnetx86RootPath }}'
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ retryCountOnTaskFailure: 1
+
+ - task: MSBuild@1
+ displayName: 'Run Manual Tests ${{parameters.msbuildArchitecture }}'
+ inputs:
+ solution: build.proj
+ msbuildArchitecture: ${{parameters.msbuildArchitecture }}
+ platform: '${{parameters.platform }}'
+ configuration: '${{parameters.configuration }}'
+ ${{ if eq(parameters.msbuildArchitecture, 'x64') }}:
+ msbuildArguments: '-t:RunManualTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }}'
+ ${{ else }}: # x86
+ msbuildArguments: '-t:RunManualTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }} -p:DotnetPath=${{parameters.dotnetx86RootPath }}'
+ condition: eq(variables['Agent.OS'], 'Windows_NT')
+ retryCountOnTaskFailure: 2
+
+- ${{ else }}: # Linux or macOS
+ - task: DotNetCoreCLI@2
+ displayName: 'Run Functional Tests'
+ inputs:
+ command: custom
+ projects: build.proj
+ custom: msbuild
+ arguments: '-t:RunFunctionalTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }} -p:platform=${{parameters.platform }} -p:Configuration=${{parameters.configuration }}'
+ verbosityRestore: Detailed
+ verbosityPack: Detailed
+ retryCountOnTaskFailure: 1
+ condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
+
+ - task: DotNetCoreCLI@2
+ displayName: 'Run Manual Tests'
+ inputs:
+ command: custom
+ projects: build.proj
+ custom: msbuild
+ arguments: '-t:RunManualTests -p:TF=${{parameters.targetFramework }} -p:TestSet=${{parameters.testSet }} -p:ReferenceType=${{parameters.referenceType }} -p:TestMicrosoftDataSqlClientVersion=${{parameters.nugetPackageVersion }} -p:platform=${{parameters.platform }} -p:Configuration=${{parameters.configuration }}'
+ verbosityRestore: Detailed
+ verbosityPack: Detailed
+ retryCountOnTaskFailure: 2
+ condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
diff --git a/eng/pipelines/common/templates/steps/update-config-file-step.yml b/eng/pipelines/common/templates/steps/update-config-file-step.yml
index 2530f35d23..78a1cfebe3 100644
--- a/eng/pipelines/common/templates/steps/update-config-file-step.yml
+++ b/eng/pipelines/common/templates/steps/update-config-file-step.yml
@@ -4,6 +4,10 @@
# See the LICENSE file in the project root for more information. #
#################################################################################
parameters:
+ - name: debug
+ type: boolean
+ default: false
+
- name: TCPConnectionString
type: string
default: ''
@@ -11,25 +15,185 @@ parameters:
- name: NPConnectionString
type: string
default: ''
+
+ - name: TCPConnectionStringHGSVBS
+ type: string
+ default: ''
+
+ - name: TCPConnectionStringNoneVBS
+ type: string
+ default: ''
+
+ - name: TCPConnectionStringAASSGX
+ type: string
+ default: ''
+
+ - name: EnclaveEnabled
+ type: boolean
+ default: false
+
+ - name: TracingEnabled
+ type: boolean
+ default: false
+
+ - name: AADAuthorityURL
+ type: string
+ default: ''
+ - name: AADPasswordConnectionString
+ type: string
+ default: ''
+
+ - name: AADServicePrincipalId
+ type: string
+ default: ''
+
+ - name: AADServicePrincipalSecret
+ type: string
+ default: ''
+
+ - name: AzureKeyVaultUrl
+ type: string
+ default: ''
+
+ - name: AzureKeyVaultTenantId
+ type: string
+ default: ''
+
+ - name: UseManagedSNIOnWindows
+ type: boolean
+ default: false
+
+ - name: UserManagedIdentityClientId
+ type: string
+ default: ''
+
+ - name: FileStreamDirectory
+ type: string
+ default: ''
+
+ - name: LocalDbAppName
+ type: string
+ default: ''
+
+ - name: LocalDbSharedInstanceName
+ type: string
+ default: ''
+
+ - name: AliasName
+ type: string
+ default: ''
+
- name: SupportsIntegratedSecurity
type: boolean
default: false
+ - name: SupportsFileStream
+ type: boolean
+ default: false
+
+ - name: DNSCachingConnString
+ type: string
+ default: ''
+
+ - name: DNSCachingServerCR
+ type: string
+ default: ''
+
+ - name: DNSCachingServerTR
+ type: string
+ default: ''
+
+ - name: EnclaveAzureDatabaseConnString
+ type: string
+ default: ''
+
+ - name: IsDNSCachingSupportedCR
+ type: boolean
+ default: false
+
+ - name: IsDNSCachingSupportedTR
+ type: boolean
+ default: false
+
+ - name: IsAzureSynapse
+ type: boolean
+ default: false
+
+ - name: ManagedIdentitySupported
+ type: boolean
+ default: true
+
steps:
# All properties should be added here, and this template should be used for any manipulation of the config.json file.
- powershell: |
$jdata = Get-Content -Raw "config.default.json" | ConvertFrom-Json
foreach ($p in $jdata)
{
- if ("${{parameters.TCPConnectionString }}" -ne ""){
- $p.TCPConnectionString="${{parameters.TCPConnectionString }}"}
+ $p.TCPConnectionString="${{parameters.TCPConnectionString }}"
+
+ $p.NPConnectionString="${{parameters.NPConnectionString }}"
+
+ $p.AADAuthorityURL="${{parameters.AADAuthorityURL }}"
+
+ $p.AADPasswordConnectionString="${{parameters.AADPasswordConnectionString }}"
+
+ $p.AADServicePrincipalId="${{parameters.AADServicePrincipalId }}"
+
+ $p.AADServicePrincipalSecret="${{parameters.AADServicePrincipalSecret }}"
+
+ $p.AzureKeyVaultUrl="${{parameters.AzureKeyVaultUrl }}"
+
+ $p.AzureKeyVaultTenantId="${{parameters.AzureKeyVaultTenantId }}"
+
+ $p.UserManagedIdentityClientId="${{parameters.UserManagedIdentityClientId }}"
- if ("${{parameters.NPConnectionString }}" -ne ""){
- $p.NPConnectionString="${{parameters.NPConnectionString }}"}
+ $p.FileStreamDirectory="${{parameters.FileStreamDirectory }}"
+ $p.LocalDbSharedInstanceName="${{parameters.LocalDbSharedInstanceName }}"
+
+ $p.AliasName="${{parameters.AliasName }}"
+
+ $p.EnclaveAzureDatabaseConnString="${{parameters.EnclaveAzureDatabaseConnString }}"
+
+ $p.DNSCachingServerTR="${{parameters.DNSCachingServerTR }}"
+
+ $p.DNSCachingServerCR="${{parameters.DNSCachingServerCR }}"
+
+ $p.DNSCachingConnString="${{parameters.DNSCachingConnString }}"
+
+ $p.SupportsFileStream="${{parameters.SupportsFileStream }}"
+
+ $p.LocalDbAppName="${{parameters.LocalDbAppName }}"
+
+ $p.TCPConnectionStringAASSGX="${{parameters.TCPConnectionStringAASSGX }}"
+
+ $p.TCPConnectionStringNoneVBS="${{parameters.TCPConnectionStringNoneVBS }}"
+
+ $p.TCPConnectionStringHGSVBS="${{parameters.TCPConnectionStringHGSVBS }}"
+
+ $p.UseManagedSNIOnWindows=[System.Convert]::ToBoolean("${{parameters.UseManagedSNIOnWindows }}")
$p.SupportsIntegratedSecurity=[System.Convert]::ToBoolean("${{parameters.SupportsIntegratedSecurity }}")
+ $p.ManagedIdentitySupported=[System.Convert]::ToBoolean("${{parameters.ManagedIdentitySupported }}")
+ $p.IsAzureSynapse=[System.Convert]::ToBoolean("${{parameters.IsAzureSynapse }}")
+ $p.IsDNSCachingSupportedTR=[System.Convert]::ToBoolean("${{parameters.IsDNSCachingSupportedTR }}")
+ $p.IsDNSCachingSupportedCR=[System.Convert]::ToBoolean("${{parameters.IsDNSCachingSupportedCR }}")
+ $p.TracingEnabled=[System.Convert]::ToBoolean("${{parameters.TracingEnabled }}")
+ $p.EnclaveEnabled=[System.Convert]::ToBoolean("${{parameters.EnclaveEnabled }}")
}
$jdata | ConvertTo-Json | Set-Content "config.json"
workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
displayName: 'Update config.json'
+
+- ${{ if eq(parameters.debug, true) }}:
+ - powershell: |
+ $jdata = Get-Content -Raw "config.json" | ConvertFrom-Json
+ foreach ($p in $jdata)
+ {
+ foreach ($prop in $p.PSObject.Properties)
+ {
+ Write-Host "Property: $($prop.Name) Value: $($prop.Value)"
+ }
+ }
+ workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
+ displayName: 'Read config.json [debug]'
diff --git a/eng/pipelines/common/templates/steps/update-nuget-config-local-feed-step.yml b/eng/pipelines/common/templates/steps/update-nuget-config-local-feed-step.yml
index 5258a3941d..6f5a528345 100644
--- a/eng/pipelines/common/templates/steps/update-nuget-config-local-feed-step.yml
+++ b/eng/pipelines/common/templates/steps/update-nuget-config-local-feed-step.yml
@@ -4,6 +4,10 @@
# See the LICENSE file in the project root for more information. #
#################################################################################
parameters:
+ - name: debug
+ type: boolean
+ default: false
+
- name: downloadedNugetPath # path to the downloaded nuget files
type: string
@@ -25,26 +29,33 @@ steps:
# Get a list of package sources available after the change
Get-PackageSource
- #Set the Nuget.config file in the project to use extracted package
+ #Set the NuGet.config file in the project to use extracted package
$rootFolder = Get-location
- [Xml] $nugetConfig = Get-Content -Path "Nuget.config"
+ [Xml] $nugetConfig = Get-Content -Path "NuGet.config"
$Value = Resolve-Path ${{parameters.downloadedNugetPath }}
$newAdd = $nugetConfig.CreateElement("add")
$newAdd.SetAttribute("key","Package source")
- $newAdd.SetAttribute("value", "$Value\" )
+ $newAdd.SetAttribute("value", "$Value/" )
$nugetConfig.configuration.packageSources.AppendChild($newAdd)
- $nugetConfig.Save("$rootFolder\Nuget.config")
+ $nugetConfig.Save("$rootFolder/NuGet.config")
displayName: 'Update NuGet config file to read from Nuget folder'
-- task: MSBuild@1
- displayName: 'Restore nugets'
+- ${{ if parameters.debug }}:
+ - powershell: |
+ # Display the content of the NuGet.config file
+ Get-Content -Path "NuGet.config"
+ displayName: 'Read NuGet.config [debug]'
+
+- task: DotNetCoreCLI@2
+ displayName: 'Restore NuGets'
inputs:
- solution: build.proj
- msbuildArchitecture: x64
- msbuildArguments: '-t:restore'
+ command: 'custom'
+ custom: 'msbuild'
+ arguments: 'build.proj -t:restore'
+ feedsToUse: 'select'
- powershell: |
- $Doc = [xml](Get-Content ".\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj")
+ $Doc = [xml](Get-Content "./Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj")
$parent_xpath = '/Project/ItemGroup/ProjectReference'
$node = $Doc.SelectSingleNode($parent_xpath)
$parentNode = $node.ParentNode
diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml
new file mode 100644
index 0000000000..5683748a27
--- /dev/null
+++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml
@@ -0,0 +1,388 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+parameters: # parameters are shown up in ADO UI in a build queue time
+- name: 'debug'
+ displayName: 'Enable debug output'
+ type: boolean
+ default: false
+
+- name: targetFrameworks
+ displayName: 'Target Frameworks on Windows'
+ type: object
+ default: [net462, net6.0, net8.0]
+
+- name: targetFrameworksLinux
+ displayName: 'Target Frameworks on Non-Windows'
+ type: object
+ default: [net6.0, net8.0]
+
+- name: buildPlatforms
+ displayName: 'Build Platforms on Windows'
+ type: object
+ default: [AnyCPU]
+
+- name: testSets
+ displayName: 'Test Sets'
+ type: object
+ default: [1, 2, 3]
+
+- name: useManagedSNI
+ displayName: |
+ Use Managed/Native SNI on Windows,
+ values [false, true], [false] or [true] are allowed
+ type: object
+ default: [false, true]
+
+- name: codeCovTargetFrameworks
+ displayName: 'Code Coverage Target Frameworks'
+ type: object
+ default: [net462, net6.0]
+
+- name: buildType
+ displayName: 'Build Type'
+ default: Project
+ values:
+ - Project
+ - Package
+
+- name: defaultPoolName
+ type: string
+ default: $(ci_var_defaultPoolName)
+
+variables:
+ - template: libraries/ci-build-variables.yml@self
+
+ - name: artifactName
+ value: Artifacts
+
+ - name: defaultHostedPoolName
+ value: 'Azure Pipelines'
+
+stages:
+ - stage: build_nugets
+ displayName: 'Build NuGet Packages'
+ jobs:
+ - template: common/templates/jobs/ci-build-nugets-job.yml@self
+ parameters:
+ artifactName: $(artifactName)
+
+ - template: common/templates/stages/ci-run-tests-stage.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ buildType: ${{ parameters.buildType }}
+ ${{ if eq(parameters.buildType, 'Package') }}:
+ dependsOn: build_nugets
+
+ prebuildSteps: # steps to run prior to building and running tests on each job
+ - template: common/templates/steps/ci-prebuild-step.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ artifactName: $(artifactName)
+ buildType: ${{ parameters.buildType }}
+
+ ${{ if eq(parameters.buildType, 'Project') }}: # only run the code coverage job if the build type is project
+ postTestJobs: # jobs to run after the tests are done
+ - template: common/templates/jobs/ci-code-coverage-job.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ downloadArtifactsSteps:
+ - ${{ each targetFramework in parameters.codeCovTargetFrameworks }}:
+ - task: DownloadPipelineArtifact@2
+ displayName: 'Download Coverage Reports [${{ targetFramework }}]'
+ inputs:
+ itemPattern: '**\${{ targetFramework }}*'
+ ${{ if contains(targetFramework, 'net4') }}:
+ targetPath: '$(Build.SourcesDirectory)\coverageNetFx'
+ ${{ else }}:
+ targetPath: '$(Build.SourcesDirectory)\coverageNetCore'
+
+# test stages configurations
+ # self hosted SQL Server on Windows
+ testConfigurations:
+ windows_sql_19: # configuration name
+ pool: ${{parameters.defaultPoolName }} # pool name
+ hostedPool: false # whether the pool is hosted or not
+ images: # list of images to run tests on
+ Win22_Sql19: ADO-MMS22-SQL19 # stage display name: image name from the pool
+ TargetFrameworks: ${{parameters.targetFrameworks }} #[net462, net6.0, net8.0] # list of target frameworks to run
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: ${{parameters.testSets }} # [1, 2, 3] # list of test sets to run
+ useManagedSNI: ${{parameters.useManagedSNI }} # can be used for .NET Core only tests on Windows: [false, true], [false] or [true] values are allowed
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }} # targeted frameworks that is going to participate in test result report generation
+ configSqlFor: local # setup Sql Server (local | azure | enclave)
+ operatingSystem: Windows # operating system to run tests on (Windows | Linux | Mac)
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(SQL_TCP_CONN_STRING)
+ NPConnectionString: $(SQL_NP_CONN_STRING)
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: $(SupportsIntegratedSecurity)
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ FileStreamDirectory: $(FileStreamDirectory)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+ AliasName: $(SQLAliasName)
+ # extra config properties
+ x86TestTargetFrameworks: [net6.0] # target frameworks should run tests on x86 as well
+ SQLRootPath: $(SQL19RootPath)
+ enableLocalDB: true
+ # instanceName: default: MSSQLSERVER
+ # user: default: $(user)
+ # saUser: default: $(saUser)
+ # password: default: $(password)
+ # fileStreamDirectory: default: ''
+ # x64AliasRegistryPath: default: $(x64AliasRegistryPath)
+ # x86AliasRegistryPath: default: $(x86AliasRegistryPath)
+ # SQLAliasName: default: $(SQLAliasName)
+ # SQLAliasPort: default: $(SQLAliasPort)
+ # targetNetCoreVersion: default: $(MainTargetNetCoreVersion)
+ # databaseName: default: Northwind
+ # localDbAppName: default: $(LocalDbAppName)
+ # localDbSharedInstanceName: default: $(LocalDbSharedInstanceName)
+ # skipSqlConfiguration: # skips the SQL configuration step
+
+ windows_sql_22:
+ pool: ${{parameters.defaultPoolName }}
+ images:
+ Win22_Sql22: ADO-MMS22-SQL22
+ TargetFrameworks: ${{parameters.targetFrameworks }}
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: ${{parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: local
+ operatingSystem: Windows
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(SQL_TCP_CONN_STRING)
+ NPConnectionString: $(SQL_NP_CONN_STRING)
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: $(SupportsIntegratedSecurity)
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ FileStreamDirectory: $(FileStreamDirectory)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+ AliasName: $(SQLAliasName)
+ # extra config properties
+ x86TestTargetFrameworks: [net462] # target frameworks should run tests on x86 as well
+ SQLRootPath: $(SQL22RootPath)
+ enableLocalDB: true
+
+ windows_sql_22_named_instance:
+ pool: ${{parameters.defaultPoolName }}
+ images:
+ Win22_Sql22_named_instance: ADO-MMS22-SQL22-WITH-NAMED-INSTANCE
+ TargetFrameworks: ${{parameters.targetFrameworks }}
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: ${{parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: local
+ operatingSystem: Windows
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(SQL_TCP_INSTANCE_CONN_STRING)
+ NPConnectionString: $(SQL_NP_INSTANCE_CONN_STRING)
+ SupportsIntegratedSecurity: $(SupportsIntegratedSecurity)
+ # extra config properties
+ SQLRootPath: $(SQL22RootPath)
+ instanceName: $(NamedInstance)
+
+ # Azure SQL Server - Windows
+ windows_azure_sql:
+ pool: ${{parameters.defaultPoolName }}
+ images:
+ Win22_Azure_Sql: ADO-MMS22-SQL19
+ win11_Azure_Sql: ADO-CI-Win11
+ TargetFrameworks: ${{parameters.targetFrameworks }}
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: ${{parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: azure
+ operatingSystem: Windows
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING)
+ NPConnectionString: $(AZURE_DB_NP_CONN_STRING)
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: false
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+
+ windows_azure_arm64_sql:
+ pool: ADO-CI-PUBLIC-ARM64-1ES-EUS-POOL
+ images:
+ Win22_Azure_ARM64_Sql: ADO-WIN11-ARM64
+ TargetFrameworks: ${{parameters.targetFrameworks }}
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: ${{parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: azure
+ operatingSystem: Windows
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING_eastus)
+ NPConnectionString: $(AZURE_DB_NP_CONN_STRING_eastus)
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR_eastus)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: false
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId_eastus)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+
+ windows_enclave_sql:
+ pool: ADO-CI-AE-1ES-Pool
+ images:
+ Win22_Enclave_Sql19: ADO-MMS22-SQL19
+ TargetFrameworks: ${{parameters.targetFrameworks }}
+ buildPlatforms: ${{parameters.buildPlatforms }}
+ testSets: [AE]
+ useManagedSNI: ${{parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: enclave
+ operatingSystem: Windows
+ configProperties:
+ # config.json properties
+ TCPConnectionStringHGSVBS: $(SQL_TCP_CONN_STRING_HGSVBS)
+ TCPConnectionStringNoneVBS: $(SQL_TCP_CONN_STRING_NoneVBS)
+ TCPConnectionStringAASSGX: $(SQL_TCP_CONN_STRING_AASSGX)
+ EnclaveEnabled: true
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: $(SupportsIntegratedSecurity)
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ AliasName: $(SQLAliasName)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+
+ # self hosted SQL Server on Linux
+ linux_sql_19_22:
+ pool: ${{parameters.defaultPoolName }}
+ images:
+ Ubuntu20_Sql19: ADO-UB20-Sql19
+ Ubuntu20_Sql22: ADO-UB2004-SQL2022
+ TargetFrameworks: ${{parameters.targetFrameworksLinux }}
+ buildPlatforms: [AnyCPU]
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: [true]
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: local
+ operatingSystem: Linux
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(SQL_TCP_CONN_STRING)
+ NPConnectionString: $(SQL_NP_CONN_STRING)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: false
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+ AliasName: $(SQLAliasName)
+
+ # Azure Sql Server - Linux
+ linux_azure_sql:
+ pool: ${{parameters.defaultPoolName }}
+ images:
+ Ubuntu20_Azure_Sql: ADO-UB20-Sql19
+ TargetFrameworks: ${{parameters.targetFrameworksLinux }}
+ buildPlatforms: [AnyCPU]
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: [true]
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: azure
+ operatingSystem: Linux
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING)
+ NPConnectionString: $(AZURE_DB_NP_CONN_STRING)
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: false
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+
+ linux_enclave_sql:
+ pool: ADO-CI-AE-1ES-Pool
+ images:
+ Ubuntu20_Enclave_Sql19: ADO-UB20-Sql19
+ TargetFrameworks: ${{parameters.targetFrameworksLinux }}
+ buildPlatforms: [AnyCPU]
+ testSets: [AE]
+ useManagedSNI: [true]
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: enclave
+ operatingSystem: Linux
+ configProperties:
+ # config.json properties
+ TCPConnectionStringHGSVBS: $(SQL_TCP_CONN_STRING_HGSVBS)
+ TCPConnectionStringNoneVBS: $(SQL_TCP_CONN_STRING_NoneVBS)
+ TCPConnectionStringAASSGX: $(SQL_TCP_CONN_STRING_AASSGX)
+ EnclaveEnabled: true
+ AADAuthorityURL: $(AADAuthorityURL)
+ AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
+ AADServicePrincipalId: $(AADServicePrincipalId)
+ AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ AzureKeyVaultUrl: $(AzureKeyVaultUrl)
+ AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
+ SupportsIntegratedSecurity: false
+ UserManagedIdentityClientId: $(UserManagedIdentityClientId)
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
+
+ # Azure Sql Server - Mac
+ mac_azure_sql:
+ pool: $(defaultHostedPoolName)
+ hostedPool: true
+ images:
+ MacOS12_Azure_Sql: macOS-12
+ TargetFrameworks: ${{parameters.targetFrameworksLinux }}
+ buildPlatforms: [AnyCPU]
+ testSets: ${{parameters.testSets }}
+ useManagedSNI: [true]
+ codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
+ configSqlFor: azure
+ operatingSystem: Mac
+ configProperties:
+ # config.json properties
+ TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING)
+ NPConnectionString: $(AZURE_DB_NP_CONN_STRING)
+ SupportsIntegratedSecurity: false
+ ManagedIdentitySupported: false
+ LocalDbAppName: $(LocalDbAppName)
+ LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
diff --git a/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml b/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml
new file mode 100644
index 0000000000..20c2102f23
--- /dev/null
+++ b/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml
@@ -0,0 +1,94 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+
+name: $(DayOfYear)$(Rev:rr)
+trigger:
+ batch: true
+ branches:
+ include:
+ - main
+ - internal/main
+ paths:
+ include:
+ - src\Microsoft.Data.SqlClient\netcore\ref
+ - src\Microsoft.Data.SqlClient\netfx\ref
+ - src\Microsoft.Data.SqlClient\ref
+ - eng
+ - tools
+ - .config
+ - Nuget.config
+
+schedules:
+- cron: '0 4 * * Fri'
+ displayName: Weekly Thursday 9:00 PM (UTC - 7) Build
+ branches:
+ include:
+ - internal/main
+ always: true
+
+- cron: '0 0 * * Mon-Fri'
+ displayName: Daily build 5:00 PM (UTC - 7) Build
+ branches:
+ include:
+ - main
+ always: true
+
+parameters: # parameters are shown up in ADO UI in a build queue time
+- name: 'debug'
+ displayName: 'Enable debug output'
+ type: boolean
+ default: false
+
+- name: targetFrameworks
+ displayName: 'Target Frameworks on Windows'
+ type: object
+ default: [net462, net6.0, net8.0]
+
+- name: targetFrameworksLinux
+ displayName: 'Target Frameworks on Non-Windows'
+ type: object
+ default: [net6.0, net8.0]
+
+- name: buildPlatforms
+ displayName: 'Build Platforms on Windows'
+ type: object
+ default: [AnyCPU]
+
+- name: testSets
+ displayName: 'Test Sets'
+ type: object
+ default: [1, 2, 3]
+
+- name: useManagedSNI
+ displayName: |
+ Use Managed/Native SNI on Windows,
+ values [false, true], [false] or [true] are allowed
+ type: object
+ default: [false, true]
+
+- name: codeCovTargetFrameworks
+ displayName: 'Code Coverage Target Frameworks'
+ type: object
+ default: [net462, net6.0]
+
+- name: buildType
+ displayName: 'Build Type'
+ default: Package
+ values:
+ - Project
+ - Package
+
+extends:
+ template: dotnet-sqlclient-ci-core.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ targetFrameworks: ${{ parameters.targetFrameworks }}
+ targetFrameworksLinux: ${{ parameters.targetFrameworksLinux }}
+ buildPlatforms: ${{ parameters.buildPlatforms }}
+ testSets: ${{ parameters.testSets }}
+ useManagedSNI: ${{ parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
+ buildType: ${{ parameters.buildType }}
diff --git a/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml b/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml
new file mode 100644
index 0000000000..c1ce940d69
--- /dev/null
+++ b/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml
@@ -0,0 +1,86 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+
+name: $(DayOfYear)$(Rev:rr)
+trigger:
+ batch: true
+ branches:
+ include:
+ - main
+ - internal/main
+ paths:
+ include:
+ - src
+ - eng
+ - tools
+ - .config
+ - build.proj
+ - Nuget.config
+
+schedules:
+- cron: '0 5 * * Thu'
+ displayName: Weekly Wednesday 10:00 PM (UTC - 7) Build
+ branches:
+ include:
+ - internal/main
+ always: true
+
+parameters: # parameters are shown up in ADO UI in a build queue time
+- name: 'debug'
+ displayName: 'Enable debug output'
+ type: boolean
+ default: false
+
+- name: targetFrameworks
+ displayName: 'Target Frameworks on Windows'
+ type: object
+ default: [net462, net6.0, net8.0]
+
+- name: targetFrameworksLinux
+ displayName: 'Target Frameworks on Non-Windows'
+ type: object
+ default: [net6.0, net8.0]
+
+- name: buildPlatforms
+ displayName: 'Build Platforms on Windows'
+ type: object
+ default: [AnyCPU]
+
+- name: testSets
+ displayName: 'Test Sets'
+ type: object
+ default: [1, 2, 3]
+
+- name: useManagedSNI
+ displayName: |
+ Use Managed/Native SNI on Windows,
+ values [false, true], [false] or [true] are allowed
+ type: object
+ default: [false, true]
+
+- name: codeCovTargetFrameworks
+ displayName: 'Code Coverage Target Frameworks'
+ type: object
+ default: [net462, net6.0]
+
+- name: buildType
+ displayName: 'Build Type'
+ default: Project
+ values:
+ - Project
+ - Package
+
+extends:
+ template: dotnet-sqlclient-ci-core.yml@self
+ parameters:
+ debug: ${{ parameters.debug }}
+ targetFrameworks: ${{ parameters.targetFrameworks }}
+ targetFrameworksLinux: ${{ parameters.targetFrameworksLinux }}
+ buildPlatforms: ${{ parameters.buildPlatforms }}
+ testSets: ${{ parameters.testSets }}
+ useManagedSNI: ${{ parameters.useManagedSNI }}
+ codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
+ buildType: ${{ parameters.buildType }}
diff --git a/eng/pipelines/libraries/ci-build-variables.yml b/eng/pipelines/libraries/ci-build-variables.yml
new file mode 100644
index 0000000000..d9e100f635
--- /dev/null
+++ b/eng/pipelines/libraries/ci-build-variables.yml
@@ -0,0 +1,25 @@
+#################################################################################
+# Licensed to the .NET Foundation under one or more agreements. #
+# The .NET Foundation licenses this file to you under the MIT license. #
+# See the LICENSE file in the project root for more information. #
+#################################################################################
+
+variables:
+ - group: 'ADO Build properties'
+ - group: 'ADO CI Packaging'
+ - group: 'ADO Test Configuration Properties'
+
+ - name: buildNumber
+ value: '$(Build.BuildNumber)'
+ - name: TFNetCore
+ value: 'net6.0'
+ - name: SQLTarget
+ value: 'localhost'
+ - name: NugetPackageVersion
+ value: $(Major).$(Minor)$(Patch)-pull.1$(buildnumber)
+ - name: skipComponentGovernanceDetection
+ value: true
+ - name: runCodesignValidationInjection
+ value: false
+ - name: packagePath
+ value: '$(Build.SourcesDirectory)/packages'