Skip to content

Commit 0d45564

Browse files
Merged PR 4422: Pipeline | Initiate YAML pipelines
- A successful sample run can be found with the non-official template [here](https://dev.azure.com/SqlClientDrivers/ADO.Net/_build/results?buildId=82875&view=results) without SDL tools. - There are a few errors reported by code analyzer that need to be addressed as well. - Due to the known issue with APIScan and Onebranch, it's temporarily deactivated. Related work items: #28134
1 parent 30cd171 commit 0d45564

21 files changed

+1198
-4
lines changed

.config/CredScanSuppressions.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"tool": "Credential Scanner",
3+
"suppressions": [
4+
{
5+
"file": "src/Microsoft.Data.SqlClient/tests/Docker/DockerLinuxTest/Program.cs",
6+
"justification": "Test projects should be skipped"
7+
},
8+
{
9+
"file": "src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/TDSServerArguments.cs",
10+
"justification": "Test projects should be skipped"
11+
},
12+
{
13+
"file": "src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/TdsServerCertificate.pfx",
14+
"justification": "Test projects should be skipped"
15+
},
16+
{
17+
"file": "src/docker-compose.yml",
18+
"justification": "Docker test project should be excluded"
19+
},
20+
{
21+
"file": "doc/samples/SqlConnectionStringBuilder.cs",
22+
"justification": "Documentation could include sample data and can be ignored"
23+
}
24+
]
25+
}

.config/PolicheckExclusions.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<PoliCheckExclusions>
2+
<Exclusion Type="FolderPathStart">SRC/MICROSOFT.DATA.SQLCLIENT/TESTS</Exclusion>
3+
<Exclusion Type="FileType">.YML|.MD|.SQL</Exclusion>
4+
<Exclusion Type="FileName">NOTICE.TXT</Exclusion>
5+
</PoliCheckExclusions>

.config/tsaoptions.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"instanceUrl": "https://sqlclientdrivers.visualstudio.com/",
3-
"projectName": "ADO.NET",
4-
"areaPath": "ADO.NET",
5-
"iterationPath": "ADO.NET",
3+
"projectName": "ADO.Net",
4+
"areaPath": "ADO.Net",
5+
"iterationPath": "ADO.Net\\TSA\\SqlClient",
66
"notificationAliases": [ "SqlClient@microsoft.com" ],
77
"repositoryName": "SqlClient",
88
"codebaseName": "SqlClient",
99
"allTools": true,
10-
"template": "MSDATA_RevolutionR"
10+
"template": "MSDATA_RevolutionR",
11+
"language": "csharp",
12+
"includePathPatterns": "src/Microsoft.Data.SqlClient/*, src/Microsoft.SqlServer.Server/*, tools/*",
13+
"excludePathPatterns": "src/Microsoft.Data.SqlClient/tests/*"
1114
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#################################################################################
2+
# Licensed to the .NET Foundation under one or more agreements. #
3+
# The .NET Foundation licenses this file to you under the MIT license. #
4+
# See the LICENSE file in the project root for more information. #
5+
#################################################################################
6+
parameters:
7+
- name: symbolsFolder
8+
type: string
9+
default: symbols
10+
- name: softwareFolder
11+
type: string
12+
default: software
13+
14+
jobs:
15+
- job: build_signed_package
16+
pool:
17+
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
18+
19+
variables:
20+
- template: ../../../libraries/variables.yml@self
21+
22+
steps:
23+
- script: SET
24+
displayName: 'Print Environment Variables'
25+
- template: ../steps/build-all-configurations-signed-dlls-step.yml@self
26+
- template: ../steps/code-analyze-step.yml@self
27+
parameters:
28+
analyzeType: all
29+
- template: ../steps/esrp-code-signing-step.yml@self
30+
parameters:
31+
artifactType: dll
32+
- template: ../steps/generate-nuget-package-step.yml@self
33+
parameters:
34+
OutputDirectory: $(artifactDirectory)
35+
- template: ../steps/esrp-code-signing-step.yml@self
36+
parameters:
37+
artifactType: pkg
38+
- powershell: |
39+
$software = '${{parameters.softwareFolder}}'
40+
md $software
41+
md $software\win
42+
md $software\win\net46
43+
md $software\win\net6.0
44+
md $software\win\net8.0
45+
md $software\win\netstandard2.0
46+
md $software\win\netstandard2.1
47+
48+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netfx\Microsoft.Data.SqlClient.dll" "$software\win\net46" -recurse
49+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\net6.0\Microsoft.Data.SqlClient.dll" "$software\win\net6.0" -recurse
50+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\net8.0\Microsoft.Data.SqlClient.dll" "$software\win\net8.0" -recurse
51+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\netstandard2.0\Microsoft.Data.SqlClient.dll" "$software\win\netstandard2.0" -recurse
52+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\netstandard2.1\Microsoft.Data.SqlClient.dll" "$software\win\netstandard2.1" -recurse
53+
54+
$symbols = '${{parameters.symbolsFolder}}'
55+
md $symbols
56+
md $symbols\win
57+
md $symbols\win\net46
58+
md $symbols\win\net6.0
59+
md $symbols\win\net8.0
60+
md $symbols\win\netstandard2.0
61+
md $symbols\win\netstandard2.1
62+
63+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netfx\Microsoft.Data.SqlClient.pdb" "$symbols\win\net46" -recurse
64+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\net6.0\Microsoft.Data.SqlClient.pdb" "$symbols\win\net6.0" -recurse
65+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\net8.0\Microsoft.Data.SqlClient.pdb" "$symbols\win\net8.0" -recurse
66+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\netstandard2.0\Microsoft.Data.SqlClient.pdb" "$symbols\win\netstandard2.0" -recurse
67+
Copy-Item "artifacts\Project\bin\Windows_NT\Release.AnyCPU\Microsoft.Data.SqlClient\netcore\netstandard2.1\Microsoft.Data.SqlClient.pdb" "$symbols\win\netstandard2.1" -recurse
68+
69+
Write-Host "Artifacts fetched for testing"
70+
dir
71+
Get-Location
72+
displayName: 'Prepare Arifacts for Testing'
73+
# Publish symbols to private server
74+
- template: ../steps/publish-symbols-step.yml@self
75+
parameters:
76+
SymAccount: $(PrivateSymAccount)
77+
# Publish symbols to public server
78+
- template: ../steps/publish-symbols-step.yml@self
79+
parameters:
80+
SymAccount: $(PublicSymAccount)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#################################################################################
2+
# Licensed to the .NET Foundation under one or more agreements. #
3+
# The .NET Foundation licenses this file to you under the MIT license. #
4+
# See the LICENSE file in the project root for more information. #
5+
#################################################################################
6+
parameters:
7+
- name: downloadPackageStep
8+
type: step
9+
default:
10+
script: echo <empty step>
11+
12+
- name: packageFolderName
13+
type: string
14+
default: drop_build_build_signed_package
15+
16+
- name: dependsOn
17+
type: string
18+
default: empty
19+
20+
jobs:
21+
- job: run_tests_package_reference
22+
${{ if ne(parameters.dependsOn, 'empty')}}:
23+
dependsOn: '${{parameters.dependsOn }}'
24+
pool:
25+
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
26+
isCustom: true
27+
name: ADO-1ES-Pool
28+
vmImage: 'ADO-MMS22-SQL19'
29+
30+
variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
31+
- template: ../../../libraries/build-variables.yml@self
32+
- template: ../../../libraries/validation-variables.yml@self
33+
34+
steps:
35+
- template: ../steps/pre-build-step.yml
36+
37+
- ${{parameters.downloadPackageStep }}
38+
39+
- template: ../steps/update-nuget-config-local-feed-step.yml
40+
parameters:
41+
downloadedNugetPath: $(Pipeline.Workspace)\${{parameters.packageFolderName }}
42+
43+
- template: ../steps/update-config-file-step.yml
44+
parameters:
45+
TCPConnectionString: $(SQL_TCP_CONN_STRING)
46+
NPConnectionString: $(SQL_NP_CONN_STRING)
47+
SupportsIntegratedSecurity: false
48+
49+
- template: ../steps/prepare-test-db-step.yml
50+
51+
# build & test
52+
- template: ../steps/build-and-run-tests-netfx-step.yml
53+
parameters:
54+
referenceType: Package
55+
56+
- template: ../steps/build-and-run-tests-netcore-step.yml
57+
parameters:
58+
referenceType: Package
59+
cleanFirst: true

0 commit comments

Comments
 (0)