forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
198 lines (185 loc) · 5.59 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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.11'
inputs:
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
azdev verify license
- job: IndexVerify
displayName: "Verify Extensions Index"
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.11
- 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'
Python311:
python.version: '3.11'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: pip install wheel==0.30.0
displayName: 'Install wheel==0.30.0'
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
az --version
python scripts/ci/test_source.py -v
displayName: 'Run integration test and build test'
env:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: AzdevStyleModifiedExtensions
displayName: "azdev style on Modified Extensions"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
continueOnError: true
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
# overwrite the default AZURE_EXTENSION_DIR set by ADO
AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/azdev_linter_style.py --type style
displayName: "azdev style on Modified Extensions"
env:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: AzdevLinterModifiedExtensions
displayName: "azdev 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.11'
inputs:
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
# overwrite the default AZURE_EXTENSION_DIR set by ADO
AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version
# TODO: remove --type linter once all extensions are fixed
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/azdev_linter_style.py --type linter
displayName: "azdev linter on Modified Extensions"
env:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
#- job: IndexRefDocVerify
# displayName: "Verify Ref Docs"
# continueOnError: true
# pool:
# name: 'pool-ubuntu-2004'
# steps:
# - task: UsePythonVersion@0
# displayName: 'Use Python 3.11'
# inputs:
# versionSpec: 3.11
# - 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