206 строки
5.3 KiB
YAML
206 строки
5.3 KiB
YAML
resources:
|
|
- repo: self
|
|
|
|
trigger:
|
|
batch: true
|
|
branches:
|
|
include:
|
|
- '*'
|
|
|
|
pr:
|
|
branches:
|
|
include:
|
|
- '*'
|
|
|
|
jobs:
|
|
- job: CredScan
|
|
displayName: "Credential Scan"
|
|
pool:
|
|
name: 'pool-windows-2019'
|
|
steps:
|
|
- task: ms-codeanalysis.vss-microsoft-security-code-analysis-devops.build-task-credscan.CredScan@2
|
|
displayName: 'Run Credential Scanner'
|
|
inputs:
|
|
toolMajorVersion: V2
|
|
suppressionsFile: './scripts/ci/credscan/CredScanSuppressions.json'
|
|
toolVersionV2: '2.1.17'
|
|
- task: ms-codeanalysis.vss-microsoft-security-code-analysis-devops.build-task-postanalysis.PostAnalysis@1
|
|
displayName: 'Post Analysis'
|
|
inputs:
|
|
AllTools: false
|
|
BinSkim: false
|
|
CredScan: true
|
|
RoslynAnalyzers: false
|
|
TSLint: false
|
|
ToolLogsNotFoundAction: 'Standard'
|
|
|
|
- job: PolicyCheck
|
|
displayName: "Policy Check"
|
|
pool:
|
|
name: 'pool-windows-2019'
|
|
steps:
|
|
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
|
|
displayName: 'Run Policy Check'
|
|
inputs:
|
|
targetType: F
|
|
result: PoliCheckResult.xml
|
|
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
|
|
displayName: 'Post Analysis'
|
|
inputs:
|
|
GdnBreakAllTools: false
|
|
GdnBreakGdnToolPoliCheck: true
|
|
GdnBreakGdnToolPoliCheckSeverity: Error
|
|
|
|
- job: CheckLicenseHeader
|
|
displayName: "Check License"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.10'
|
|
inputs:
|
|
versionSpec: 3.10
|
|
- bash: |
|
|
set -ev
|
|
|
|
# prepare and activate virtualenv
|
|
python -m venv env/
|
|
|
|
chmod +x ./env/bin/activate
|
|
source ./env/bin/activate
|
|
|
|
# clone azure-cli
|
|
git clone -q --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli
|
|
|
|
python -m pip install -U pip
|
|
pip install -q azdev
|
|
|
|
azdev setup -c ../azure-cli -r ./
|
|
|
|
azdev --version
|
|
az --version
|
|
|
|
azdev verify license
|
|
|
|
- job: StaticAnalysis
|
|
displayName: "Static Analysis"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.6'
|
|
inputs:
|
|
versionSpec: 3.6
|
|
- bash: pip install wheel==0.30.0 pylint==1.9.5 flake8==3.5.0 requests
|
|
displayName: 'Install wheel, pylint, flake8, requests'
|
|
- bash: python scripts/ci/source_code_static_analysis.py
|
|
displayName: "Static Analysis"
|
|
|
|
- job: IndexVerify
|
|
displayName: "Verify Extensions Index"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.10'
|
|
inputs:
|
|
versionSpec: 3.10
|
|
- bash: |
|
|
#!/usr/bin/env bash
|
|
set -ev
|
|
pip install wheel==0.30.0 requests packaging
|
|
export CI="ADO"
|
|
python ./scripts/ci/test_index.py -v
|
|
displayName: "Verify Extensions Index"
|
|
|
|
- job: SourceTests
|
|
displayName: "Integration Tests, Build Tests"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
strategy:
|
|
matrix:
|
|
Python38:
|
|
python.version: '3.8'
|
|
Python39:
|
|
python.version: '3.9'
|
|
Python310:
|
|
python.version: '3.10'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python $(python.version)'
|
|
inputs:
|
|
versionSpec: '$(python.version)'
|
|
- bash: pip install wheel==0.30.0
|
|
displayName: 'Install wheel==0.30.0'
|
|
- bash: ./scripts/ci/test_source.sh
|
|
displayName: 'Run integration test and build test'
|
|
env:
|
|
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
|
|
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
|
|
|
|
- job: LintModifiedExtensions
|
|
displayName: "CLI Linter on Modified Extensions"
|
|
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.10'
|
|
inputs:
|
|
versionSpec: 3.10
|
|
- bash: |
|
|
set -ev
|
|
|
|
# prepare and activate virtualenv
|
|
pip install virtualenv
|
|
python -m virtualenv venv/
|
|
source ./venv/bin/activate
|
|
|
|
# clone azure-cli
|
|
git clone --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli
|
|
|
|
python -m pip install -U pip
|
|
pip install azdev
|
|
|
|
azdev --version
|
|
|
|
azdev setup -c ../azure-cli -r ./
|
|
|
|
# overwrite the default AZURE_EXTENSION_DIR set by ADO
|
|
AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version
|
|
|
|
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/verify_linter.py
|
|
displayName: "CLI Linter on Modified Extension"
|
|
env:
|
|
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
|
|
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
|
|
|
|
- job: IndexRefDocVerify
|
|
displayName: "Verify Ref Docs"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.10'
|
|
inputs:
|
|
versionSpec: 3.10
|
|
- bash: pip install wheel==0.30.0
|
|
displayName: 'Install wheel==0.30.0'
|
|
- task: Bash@3
|
|
displayName: "Verify Extension Ref Docs"
|
|
inputs:
|
|
targetType: 'filePath'
|
|
filePath: scripts/ci/test_index_ref_doc.sh
|
|
|
|
- job: CheckInit
|
|
displayName: "Check Init Files"
|
|
pool:
|
|
name: 'pool-ubuntu-2004'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
displayName: 'Use Python 3.x'
|
|
inputs:
|
|
versionSpec: 3.x
|
|
- bash: |
|
|
python scripts/ci/test_init.py -v
|