build: update build pipeline; move release pipeline to internal ADO account

This commit is contained in:
Jason Wang 2024-03-07 23:33:53 -08:00
Родитель fedd24338c
Коммит 16cb61c6c7
3 изменённых файлов: 12 добавлений и 156 удалений

21
.github/workflows/build.yml поставляемый
Просмотреть файл

@ -9,19 +9,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
Solution_Name: csharp/Microsoft.Azure.Databricks.Client.sln
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
@ -34,6 +33,9 @@ jobs:
- name: Test
run: dotnet test "$Solution_Name" --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Package
run: dotnet pack "$Solution_Name" --no-build --configuration Release --verbosity Detailed
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
@ -47,9 +49,10 @@ jobs:
output: both
thresholds: '50 75'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
recreate: true
path: code-coverage-results.md
name: artifacts
path: |
code-coverage-results.md
**/bin/**

Просмотреть файл

@ -1,146 +0,0 @@
---
pool:
name: CDML
demands: ImageOverride -equals MMS2022
variables:
solution: "**/*.sln"
buildConfiguration: "Release"
major: 2
minor: 2
patch: 1
suffix: ''
jobs:
- job: Build
variables:
prid: $(system.pullrequest.pullrequestid)
prrevision: $[counter(variables['system.pullrequest.pullrequestid'], 0)]
steps:
- bash: |
echo "##vso[build.updatebuildnumber]$(major).$(minor).$(patch)-pr.$(prid).$(prrevision)"
displayName: Set PR BuildNumber
condition: eq(variables['Build.Reason'], 'PullRequest')
- bash: |
echo "##vso[build.updatebuildnumber]$(major).$(minor).$(patch)$(suffix)"
displayName: Set Branch BuildNumber
condition: ne(variables['Build.Reason'], 'PullRequest')
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: "build"
projects: "$(solution)"
arguments: "-p:Version=$(Build.BuildNumber) -p:Configuration=$(buildConfiguration)"
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: "test"
projects: "$(solution)"
arguments: "-p:Version=$(Build.BuildNumber) -p:Configuration=$(buildConfiguration)"
- task: UseDotNet@2
displayName: Use .NET 6 for ESRP
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
version: '6.0.x'
- task: EsrpCodeSigning@1
displayName: code sign dll
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
ConnectedServiceName: "ESRP Code Signing"
FolderPath: 'csharp\Microsoft.Azure.Databricks.Client\bin\$(buildConfiguration)'
Pattern: "Microsoft.Azure.Databricks.Client.dll"
signConfigType: "inlineSignParams"
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: "60"
MaxConcurrency: "50"
MaxRetryAttempts: "5"
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: "pack"
packagesToPack: "$(solution)"
configuration: "$(buildConfiguration)"
nobuild: true
versioningScheme: "off"
buildProperties: "Version=$(Build.BuildNumber)"
packDirectory: "$(Build.ArtifactStagingDirectory)"
- task: EsrpCodeSigning@1
displayName: code sign nupkg
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
ConnectedServiceName: "ESRP Code Signing"
FolderPath: "$(Build.ArtifactStagingDirectory)"
Pattern: "*.*nupkg"
signConfigType: "inlineSignParams"
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: "60"
MaxConcurrency: "50"
MaxRetryAttempts: "5"
- task: CopyFiles@2
displayName: Copy Files to $(Build.ArtifactStagingDirectory)
inputs:
SourceFolder: "$(Build.SourcesDirectory)"
Contents: |
**\bin\**
*.*nupkg
TargetFolder: "$(Build.ArtifactStagingDirectory)"
CleanTargetFolder: false
- task: PublishBuildArtifacts@1
displayName: Publish Artifacts to drop
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"
publishLocation: "Container"

Просмотреть файл

@ -852,7 +852,6 @@ public class PipelinesApiClientTest : ApiClientTest
[TestMethod]
public async Task TestStart()
{
var maxResults = 25;
var pipelineId = "1234-567890-cited123";
var apiUri = $"{PipelineApiUri}/{pipelineId}/updates";