-
Notifications
You must be signed in to change notification settings - Fork 63
[ci] Switch to using the 1ES mandated pipeline template. #844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,122 +1,82 @@ | ||
| parameters: | ||
| # Environment Parameters | ||
| name: 'build' # the name of the build job for dependency purposes | ||
| timeoutInMinutes: 300 # the timeout in minutes | ||
| mainBranchName: 'main' # the "main" branch that should be used - can be something other than "main" | ||
| macosAgentPoolName: 'Azure Pipelines' # the name of the macOS VM pool | ||
| # https://github.com/actions/runner-images | ||
| macosImage: internal-macos12 # macOS VM image name, must be "internal" locked down image | ||
| windowsAgentPoolName: android-win-2022 # the name of the Windows VM pool | ||
| windowsImage: 'windows-latest' # the name of the Windows VM image | ||
| name: # Job display name | ||
| buildPool: # VM pool information | ||
| classicInstallerUrl: # URL to retrieve the Classic XA installer | ||
|
|
||
| # Build Parameters | ||
| mainBranchName: 'main' # Name of Git "main" branch | ||
| configuration: 'Release' # Build configuration: 'Debug', 'Release' | ||
| verbosity: 'normal' # Build verbosity: 'minimal', 'normal', 'diagnostic' | ||
| timeoutInMinutes: 300 # Max job runtime in minutes | ||
| runAPIScan: false # Run APIScan analysis | ||
|
|
||
| # Tool Parameters | ||
| dotnetVersion: '7.0.405' # the version of .NET to use | ||
| dotnetWorkloadRollbackFile: 'workloads.json' | ||
| dotnetWorkloadSource: 'https://aka.ms/dotnet6/nuget/index.json' | ||
| dotnetNuGetOrgSource: 'https://api.nuget.org/v3/index.json' | ||
| classicXAPkg: https://aka.ms/xamarin-android-commercial-d17-4-macos | ||
| classicXAVsix: https://aka.ms/xamarin-android-commercial-d17-4-windows | ||
| skipUnitTests: false # do not run unit test step | ||
| dotnetVersion: '7.0.406' # .NET version to install on agent | ||
| dotnetWorkloadRollbackFile: 'workloads.json' # Rollback file specifying workload versions to install | ||
| dotnetNuGetOrgSource: 'https://api.nuget.org/v3/index.json' # NuGet.org URL to find workloads | ||
| dotnetWorkloadSource: 'https://aka.ms/dotnet6/nuget/index.json' # .NET engineering URL to find workloads | ||
| skipUnitTests: false # Skip running unit tests | ||
|
|
||
| tools: # a list of additional .NET global tools needed | ||
| tools: # Additional .NET global tools to install | ||
| - 'xamarin.androidbinderator.tool': '0.5.7' | ||
| - 'Cake.Tool': '4.0.0' | ||
| - 'boots': '1.1.0.712-preview2' | ||
| - 'private-api-tools': '1.0.2' | ||
|
|
||
| # Build Parameters | ||
| verbosity: 'normal' # the build verbosity: 'minimal', 'normal', 'diagnostic' | ||
| configuration: 'Release' # the build configuration: 'Debug', 'Release' | ||
|
|
||
| # Reporting/Analysis Parameters | ||
| areaPath: 'DevDiv\VS Client - Runtime SDKs\Android' # the areaPath to log any issues | ||
| publishJob: '' # the job to use as the source of the 'nuget' artifact: '', 'windows', 'macos', 'linux' | ||
| publishOutputSuffix: '' # the artifact suffix to use when publishing the output folder | ||
| signListPath: 'SignList.xml' # the path to the SignList.xml to copy into the nuget artifact for signing | ||
| artifactsPath: 'output' # the path to the NuGet packages that need to be signed, verified and published | ||
| artifactsPath: 'output' # Path to the NuGet packages that need to be signed, verified and published | ||
| signListPath: 'SignList.xml' # Path to 'SignList.xml' used for signing NuGet packages | ||
|
|
||
| jobs: | ||
| - job: ${{ parameters.name }} | ||
| strategy: | ||
| matrix: | ||
| macos: | ||
| poolName: ${{ parameters.macosAgentPoolName }} | ||
| imageName: ${{ parameters.macosImage }} | ||
| classicInstallerUrl: ${{ parameters.classicXAPkg }} | ||
| runCodeQL: false | ||
| windows: | ||
| poolName: ${{ parameters.windowsAgentPoolName }} | ||
| imageName: ${{ parameters.windowsImage }} | ||
| classicInstallerUrl: ${{ parameters.classicXAVsix }} | ||
| runCodeQL: true | ||
| runAPIScan: true | ||
| displayName: Build | ||
| timeoutInMinutes: ${{ parameters.timeoutInMinutes }} | ||
| variables: | ||
| Codeql.Enabled: $(runCodeQL) | ||
| pool: | ||
| name: $(poolName) | ||
| vmImage: $(imageName) | ||
|
|
||
| steps: | ||
| - template: setup-environment.yml | ||
| parameters: | ||
| dotnetVersion: ${{ parameters.dotnetVersion }} | ||
| dotnetWorkloadRollbackFile: ${{ parameters.dotnetWorkloadRollbackFile }} | ||
| dotnetWorkloadSource: ${{ parameters.dotnetWorkloadSource }} | ||
| dotnetNuGetOrgSource: ${{ parameters.dotnetNuGetOrgSource }} | ||
| dotnetTools: ${{ parameters.tools }} | ||
| classicInstallerUrl: $(classicInstallerUrl) | ||
| - job: build_${{ parameters.name }} | ||
| displayName: ${{ parameters.name }} | ||
| timeoutInMinutes: ${{ parameters.timeoutInMinutes }} | ||
| pool: ${{ parameters.buildPool }} | ||
|
|
||
| templateContext: | ||
| sdl: | ||
pjcollins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| spotBugs: | ||
| enabled: false | ||
| binskim: | ||
| scanOutputDirectoryOnly: true | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| targetPath: ${{ parameters.artifactsPath }} | ||
| artifactName: output-${{ parameters.name }} | ||
|
|
||
| steps: | ||
| - template: setup-environment.yml | ||
| parameters: | ||
| dotnetVersion: ${{ parameters.dotnetVersion }} | ||
| dotnetWorkloadRollbackFile: ${{ parameters.dotnetWorkloadRollbackFile }} | ||
| dotnetWorkloadSource: ${{ parameters.dotnetWorkloadSource }} | ||
| dotnetNuGetOrgSource: ${{ parameters.dotnetNuGetOrgSource }} | ||
| dotnetTools: ${{ parameters.tools }} | ||
| classicInstallerUrl: ${{ parameters.classicInstallerUrl }} | ||
|
|
||
| - template: build-and-test.yml | ||
| parameters: | ||
| artifactsPath: ${{ parameters.artifactsPath }} | ||
| verbosity: ${{ parameters.verbosity }} | ||
| configuration: ${{ parameters.configuration }} | ||
| skipUnitTests: ${{ parameters.skipUnitTests }} | ||
| - template: build-and-test.yml | ||
| parameters: | ||
| artifactsPath: ${{ parameters.artifactsPath }} | ||
| verbosity: ${{ parameters.verbosity }} | ||
| configuration: ${{ parameters.configuration }} | ||
| skipUnitTests: ${{ parameters.skipUnitTests }} | ||
|
|
||
| - ${{ if eq(parameters.runAPIScan, true) }}: | ||
| - template: api-scan.yml | ||
| parameters: | ||
| mainBranchName: ${{ parameters.mainBranchName }} | ||
|
|
||
| # after the build is complete | ||
| - pwsh: | | ||
| $srcExists = (Test-Path "${{ parameters.signListPath }}") | ||
| $dstExists = (Test-Path "${{ parameters.artifactsPath }}\SignList.xml") | ||
| if ($srcExists -and !$dstExists) { | ||
| Copy-Item "${{ parameters.signListPath }}" "${{ parameters.artifactsPath }}\SignList.xml" | ||
| Write-Host "Copied ${{ parameters.signListPath }} to ${{ parameters.artifactsPath }}\SignList.xml" | ||
| } elseif (!$srcExists) { | ||
| Write-Host "${{ parameters.signListPath }} did not exist, nothing copied." | ||
| } elseif ($dstExists) { | ||
| Write-Host "${{ parameters.artifactsPath }}\SignList.xml already existed, nothing copied." | ||
| } | ||
| displayName: 'Copy SignList.xml to the nuget artifact' | ||
| - task: PublishBuildArtifacts@1 | ||
| displayName: 'Publish artifacts' | ||
| condition: or(eq('${{ parameters.publishJob }}', ''), eq('${{ parameters.publishJob }}', variables['System.JobName'])) | ||
| inputs: | ||
| PathToPublish: ${{ parameters.artifactsPath }} | ||
| ArtifactName: nuget | ||
| - task: PublishBuildArtifacts@1 | ||
| displayName: 'Publish platform artifacts' | ||
| condition: always() | ||
| inputs: | ||
| PathToPublish: output | ||
| ArtifactName: output-$(System.JobName)${{ parameters.publishOutputSuffix }} | ||
| # run any required checks | ||
| - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: | ||
| - task: ComponentGovernanceComponentDetection@0 | ||
| displayName: 'Run component detection' | ||
| condition: and(always(), eq('refs/heads/${{ parameters.mainBranchName }}', variables['Build.SourceBranch'])) | ||
| inputs: | ||
| scanType: 'Register' | ||
| verbosity: 'Verbose' | ||
| alertWarningLevel: 'High' | ||
|
|
||
| - template: code-analysis.yml | ||
| parameters: | ||
| name: ${{ parameters.name }} | ||
| mainBranchName: ${{ parameters.mainBranchName }} | ||
| areaPath: ${{ parameters.areaPath }} | ||
| configuration: ${{ parameters.configuration }} | ||
| # Copy SignList.xml to output | ||
| - pwsh: | | ||
| $srcExists = (Test-Path "${{ parameters.signListPath }}") | ||
| $dstExists = (Test-Path "${{ parameters.artifactsPath }}\SignList.xml") | ||
| if ($srcExists -and !$dstExists) { | ||
| Copy-Item "${{ parameters.signListPath }}" "${{ parameters.artifactsPath }}\SignList.xml" | ||
| Write-Host "Copied ${{ parameters.signListPath }} to ${{ parameters.artifactsPath }}\SignList.xml" | ||
| } elseif (!$srcExists) { | ||
| Write-Host "${{ parameters.signListPath }} did not exist, nothing copied." | ||
| } elseif ($dstExists) { | ||
| Write-Host "${{ parameters.artifactsPath }}\SignList.xml already existed, nothing copied." | ||
| } | ||
| displayName: Copy SignList.xml to output | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are still passing pool information at the job you should be able to safely delete this top level
poolvalue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the latest run failed, perhaps this was needed:
I ended up specifying this under the
sdlelement in other pipelines, though I'm not sure which approach is "more correct":