Skip to content

Commit

Permalink
{CI} Migrate azure cli pipelines (#24201)
Browse files Browse the repository at this point in the history
* update agent pool

* Update azure-pipelines.yml

* update

* Update build.cmd

* Update azure-pipelines.yml

* update

* Update azure-pipelines.yml

* update
  • Loading branch information
wangzelin007 authored Oct 17, 2022
1 parent f0c87ca commit c24f5fc
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines/templates/variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variables:
ubuntu_pool: 'pool-ubuntu-2004'
windows_pool: 'pool-windows-2019'
13 changes: 8 additions & 5 deletions azure-pipelines-full-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ pr:
include:
- '*'

variables:
- template: .azure-pipelines/templates/variables.yml

jobs:
- job: AutomationTest20200901
displayName: Automation Test (Profile 2020-09-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand All @@ -35,7 +38,7 @@ jobs:
displayName: Automation Test (Profile 2019-03-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand All @@ -53,7 +56,7 @@ jobs:
displayName: Automation Test (Profile 2018-03-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
instance8:
Instance_idx: 8
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand Down Expand Up @@ -123,7 +126,7 @@ jobs:
instance8:
Instance_idx: 8
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand Down
59 changes: 31 additions & 28 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ pr:
include:
- '*'

variables:
- template: .azure-pipelines/templates/variables.yml

jobs:
- job: CheckPullRequest
displayName: "Check the Format of Pull Request Title and Content"
condition: and(succeeded(), in(variables['System.PullRequest.TargetBranch'], 'dev', 'release'))

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- bash: |
echo "Check Title of Pull Request: #$(System.PullRequest.PullRequestNumber)"
Expand All @@ -37,7 +40,7 @@ jobs:
condition: and(succeeded(), eq(variables['System.PullRequest.TargetBranch'], 'master'))

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- bash: |
echo "Reject pull request directly to master branch"
Expand All @@ -46,7 +49,7 @@ jobs:
- job: CredScan
displayName: "Credential Scan"
pool:
vmImage: "windows-2019"
name: ${{ variables.windows_pool }}
steps:
- task: ms-codeanalysis.vss-microsoft-security-code-analysis-devops.build-task-credscan.CredScan@2
displayName: 'Run Credential Scanner'
Expand All @@ -69,7 +72,7 @@ jobs:

condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: Bash@3
displayName: 'Extract Version'
Expand All @@ -88,7 +91,7 @@ jobs:
displayName: 'Verify src/azure-cli/requirements.*.Linux.txt'
condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}

steps:
- task: UsePythonVersion@0
Expand Down Expand Up @@ -118,7 +121,7 @@ jobs:
displayName: 'Verify src/azure-cli/requirements.*.Windows.txt'
condition: succeeded()
pool:
vmImage: 'windows-2019'
name: ${{ variables.windows_pool }}

steps:
- task: UsePythonVersion@0
Expand All @@ -136,7 +139,7 @@ jobs:
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/release'), eq(variables['System.PullRequest.TargetBranch'], 'release')))

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand All @@ -156,7 +159,7 @@ jobs:
dependsOn: ExtractMetadata
condition: succeeded()
pool:
vmImage: 'windows-2019'
name: ${{ variables.windows_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build Artifacts'
Expand Down Expand Up @@ -189,7 +192,7 @@ jobs:
dependsOn: BuildWindowsMSI
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'windows-2019'
name: ${{ variables.windows_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build Artifacts'
Expand Down Expand Up @@ -254,7 +257,7 @@ jobs:
dependsOn: ExtractMetadata
condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: Bash@3
displayName: 'Bash Script'
Expand All @@ -280,7 +283,7 @@ jobs:
dependsOn: BuildDockerImage
condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
Expand Down Expand Up @@ -315,7 +318,7 @@ jobs:
dependsOn: ExtractMetadata
condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand Down Expand Up @@ -349,7 +352,7 @@ jobs:
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
Expand Down Expand Up @@ -396,7 +399,7 @@ jobs:
displayName: Unit Test for Core
timeoutInMinutes: 10
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand All @@ -413,7 +416,7 @@ jobs:
displayName: Unit Test for Telemetry
timeoutInMinutes: 10
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand All @@ -433,7 +436,7 @@ jobs:
timeoutInMinutes: 20

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python39:
Expand All @@ -456,7 +459,7 @@ jobs:
timeoutInMinutes: 40

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python310:
Expand All @@ -477,7 +480,7 @@ jobs:
dependsOn: BuildPythonWheel
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
Expand Down Expand Up @@ -597,7 +600,7 @@ jobs:
displayName: Build Rpm Package Mariner
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
2.0:
Expand Down Expand Up @@ -627,7 +630,7 @@ jobs:
# Do not run this job for Pull Requests due to the slowness
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Red Hat Universal Base Image 8:
Expand Down Expand Up @@ -673,7 +676,7 @@ jobs:
dependsOn: BuildRpmPackages
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Red Hat Universal Base Image 8:
Expand Down Expand Up @@ -736,7 +739,7 @@ jobs:
displayName: Build Deb Packages
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
# https://wiki.ubuntu.com/Releases
Expand Down Expand Up @@ -803,7 +806,7 @@ jobs:
deb_system: debian
distro: bullseye
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
Expand Down Expand Up @@ -835,7 +838,7 @@ jobs:
displayName: "Check CLI Style"

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand All @@ -851,7 +854,7 @@ jobs:
displayName: "Check License, History, and DocMap"

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand All @@ -874,7 +877,7 @@ jobs:
Python310:
python.version: '3.10'
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand All @@ -897,7 +900,7 @@ jobs:
displayName: "Check CLI Linter"

pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand All @@ -919,7 +922,7 @@ jobs:
- job: VerifySphinxDocumentGenerator
displayName: "Verify Sphinx Document Generator"
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/windows/scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ msbuild /t:rebuild /p:Configuration=Release %REPO_ROOT%\build_scripts\windows\az

if %errorlevel% neq 0 goto ERROR

start %OUTPUT_DIR%
echo %OUTPUT_DIR%

goto END

Expand Down
11 changes: 7 additions & 4 deletions scripts/bump_version/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ trigger:
exclude:
- '*'

variables:
- template: .azure-pipelines/templates/variables.yml

jobs:
- job: UpdateVersionFiles
displayName: CLI Bump Version Update Version Files
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
inputs:
Expand Down Expand Up @@ -79,7 +82,7 @@ jobs:
instance8:
Instance_idx: 8
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
inputs:
Expand Down Expand Up @@ -115,14 +118,14 @@ jobs:
displayName: "Rerun tests"
- task: PublishTestResults@2
inputs:
testResultsFiles: '/home/vsts/.azdev/env_config/home/vsts/work/1/s/env/test_results_*.xml'
testResultsFiles: '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env/test_results_*.xml'
testRunTitle: 'CLI Bump Version test results of instance $(Instance_idx)'

- job: CreatePR
displayName: CLI Bump Version Create PR
dependsOn: RerunTests
pool:
vmImage: 'ubuntu-20.04'
name: ${{ variables.ubuntu_pool }}
steps:
- task: AzureCLI@1
displayName: 'Create PR'
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/automation_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
profile = sys.argv[3]
serial_modules = sys.argv[4].split()
fix_failure_tests = sys.argv[5].lower() == 'true' if len(sys.argv) >= 6 else False
working_directory = "/home/vsts/work/1/s"
azdev_test_result_dir = "/home/vsts/.azdev/env_config/home/vsts/work/1/s/env"
working_directory = "/mnt/vss/_work/1/s"
azdev_test_result_dir = "/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env"
jobs = {
'acr': 45,
'acs': 62,
Expand Down
Loading

0 comments on commit c24f5fc

Please sign in to comment.