forked from cloud-custodian/cloud-custodian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
166 lines (133 loc) · 3.58 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
trigger:
- master
variables:
- group: CustodianCoreCI
- name: WINDOWS_CACHE_DIR
value: $(LOCALAPPDATA)\pip\cache
jobs:
- job: 'Lint'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- checkout: self
fetchDepth: 1
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: python -m pip install --upgrade pip && pip install flake8
displayName: "Install Dependencies"
- script: make lint
displayName: "Flake8 Lint"
- job: 'Docs'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- checkout: self
fetchDepth: 1
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: python -m pip install --upgrade pip && pip install tox
displayName: 'Install Test Runner'
- script: TOXENV=docs tox --notest
displayName: 'Install Dependencies'
- script: TOXENV=docs tox
displayName: "Docs Build"
- job: 'Test'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python27:
python.version: '2.7'
TOXENV: py27
Python36:
python.version: '3.6'
TOXENV: py36-cov
Python37:
python.version: '3.7'
TOXENV: py37
maxParallel: 3
steps:
- checkout: self
fetchDepth: 2
- task: UsePythonVersion@0
displayName: "Set Python Version"
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip && pip install tox codecov
displayName: 'Install Test Runner'
- script: tox --notest
displayName: 'Install Dependencies'
- script: tox
displayName: 'Tox'
- script: |
coverage xml && \
bash <(curl -s https://codecov.io/bash) -Z \
-X gcov -X coveragepy -X search -X xcode -X gcovout -X fix \
-f coverage.xml
displayName: 'Publish Code Coverage'
condition: "eq(variables['python.version'], '3.6')"
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: PublishTestResults@2
displayName: "Publish Test Results Azure"
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- job: 'TestWindows'
displayName: 'Test Win2019'
pool:
vmImage: 'windows-2019'
strategy:
matrix:
Python36:
python.version: '3.6'
TOXENV: py36
Python37:
python.version: '3.7'
TOXENV: py37-windows
maxParallel: 3
steps:
- checkout: self
fetchDepth: 2
- powershell: |
$date=$(Get-Date).DayOfYear;
Write-Host "##vso[task.setvariable variable=DAY_OF_YEAR]$date"
displayName: Set cache date key
- task: CacheBeta@0
inputs:
key: '"c7n-tox" | "$(python.version)" | "$(Agent.OS)" | "$(DAY_OF_YEAR)"'
path: $(WINDOWS_CACHE_DIR)
- task: UsePythonVersion@0
displayName: "Set Python Version"
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip && pip install tox
displayName: 'Install Test Runner'
- script: tox --notest
displayName: 'Install Dependencies'
- script: tox
displayName: 'Tox'
- task: PublishTestResults@2
displayName: "Publish Test Results Azure"
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version) Windows'
condition: succeededOrFailed()
- job: 'CustodianCask'
displayName: 'Container Cask'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: GoTool@0
inputs:
version: '1.12.6'
- script: make release
workingDirectory: tools/cask/
displayName: 'Build for all platforms'