forked from microsoft/mssql-django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
220 lines (192 loc) · 6.84 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
trigger:
- master
- dev
- 1ES
schedules:
- cron: "0 9 * * *"
displayName: Daily midnight build
branches:
include:
- dev
always: true
jobs:
- job: Windows
pool:
name: Django-1ES-pool
demands:
- imageOverride -equals JDBC-MMS2019-SQL2019
timeoutInMinutes: 120
strategy:
matrix:
Python3.10 - Django 4.0:
python.version: '3.10'
tox.env: 'py310-django40'
Python 3.9 - Django 4.0:
python.version: '3.9'
tox.env: 'py39-django40'
Python 3.8 - Django 4.0:
python.version: '3.8'
tox.env: 'py38-django40'
Python 3.9 - Django 3.2:
python.version: '3.9'
tox.env: 'py39-django32'
Python 3.8 - Django 3.2:
python.version: '3.8'
tox.env: 'py38-django32'
Python 3.7 - Django 3.2:
python.version: '3.7'
tox.env: 'py37-django32'
Python 3.6 - Django 3.2:
python.version: '3.6'
tox.env: 'py36-django32'
Python 3.9 - Django 3.1:
python.version: '3.9'
tox.env: 'py39-django31'
Python 3.8 - Django 3.1:
python.version: '3.8'
tox.env: 'py38-django31'
Python 3.7 - Django 3.1:
python.version: '3.7'
tox.env: 'py37-django31'
Python 3.6 - Django 3.1:
python.version: '3.6'
tox.env: 'py36-django31'
Python 3.9 - Django 3.0:
python.version: '3.9'
tox.env: 'py39-django30'
Python 3.8 - Django 3.0:
python.version: '3.8'
tox.env: 'py38-django30'
Python 3.7 - Django 3.0:
python.version: '3.7'
tox.env: 'py37-django30'
Python 3.6 - Django 3.0:
python.version: '3.6'
tox.env: 'py36-django30'
Python 3.7 - Django 2.2:
python.version: '3.7'
tox.env: 'py37-django22'
Python 3.6 - Django 2.2:
python.version: '3.6'
tox.env: 'py36-django22'
steps:
- task: CredScan@2
inputs:
toolMajorVersion: 'V2'
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: Use Python $(python.version)
- powershell: |
$IP=Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $(Get-NetConnectionProfile -IPv4Connectivity Internet | Select-Object -ExpandProperty InterfaceIndex) | Select-Object -ExpandProperty IPAddress
(Get-Content $pwd/testapp/settings.py).replace('localhost', $IP) | Set-Content $pwd/testapp/settings.py
Invoke-WebRequest https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/17.5.2.1/x64/msodbcsql.msi -OutFile msodbcsql.msi
msiexec /quiet /passive /qn /i msodbcsql.msi IACCEPTMSODBCSQLLICENSETERMS=YES
Get-OdbcDriver
displayName: Install ODBC
- powershell: |
Import-Module "sqlps"
Invoke-Sqlcmd @"
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
ALTER LOGIN [sa] ENABLE;
ALTER LOGIN [sa] WITH PASSWORD = 'MyPassword42', CHECK_POLICY=OFF;
"@
displayName: Set up SQL Server
- powershell: |
Restart-Service -Name MSSQLSERVER -Force
displayName: Restart SQL Server
- powershell: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install tox
git clone https://github.com/django/django.git
python -m tox -e $(tox.env)
displayName: Run tox
- job: Linux
pool:
name: Django-1ES-pool
demands:
- imageOverride -equals MMSUbuntu20.04
timeoutInMinutes: 120
strategy:
matrix:
Python3.10 - Django 4.0:
python.version: '3.10'
tox.env: 'py310-django40'
Python 3.9 - Django 4.0:
python.version: '3.9'
tox.env: 'py39-django40'
Python 3.8 - Django 4.0:
python.version: '3.8'
tox.env: 'py38-django40'
Python 3.9 - Django 3.2:
python.version: '3.9'
tox.env: 'py39-django32'
Python 3.8 - Django 3.2:
python.version: '3.8'
tox.env: 'py38-django32'
Python 3.7 - Django 3.2:
python.version: '3.7'
tox.env: 'py37-django32'
Python 3.6 - Django 3.2:
python.version: '3.6'
tox.env: 'py36-django32'
Python 3.9 - Django 3.1:
python.version: '3.9'
tox.env: 'py39-django31'
Python 3.8 - Django 3.1:
python.version: '3.8'
tox.env: 'py38-django31'
Python 3.7 - Django 3.1:
python.version: '3.7'
tox.env: 'py37-django31'
Python 3.6 - Django 3.1:
python.version: '3.6'
tox.env: 'py36-django31'
Python 3.9 - Django 3.0:
python.version: '3.9'
tox.env: 'py39-django30'
Python 3.8 - Django 3.0:
python.version: '3.8'
tox.env: 'py38-django30'
Python 3.7 - Django 3.0:
python.version: '3.7'
tox.env: 'py37-django30'
Python 3.6 - Django 3.0:
python.version: '3.6'
tox.env: 'py36-django30'
Python 3.7 - Django 2.2:
python.version: '3.7'
tox.env: 'py37-django22'
Python 3.6 - Django 2.2:
python.version: '3.6'
tox.env: 'py36-django22'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: Use Python $(python.version)
- script: |
docker pull mcr.microsoft.com/mssql/server:2019-latest
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyPassword42' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 g++ unixodbc-dev libmemcached-dev
displayName: Install SQL Server
- script: |
python -m pip install --upgrade pip wheel setuptools
pip install tox
git clone https://github.com/django/django.git
displayName: Install requirements
- script: tox -e $(tox.env)
displayName: Run tox
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'django/coverage.xml'
- task: PublishTestResults@2
displayName: Publish test results via jUnit
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'django/result.xml'
testRunTitle: 'junit-$(Agent.OS)-$(Agent.OSArchitecture)-$(tox.env)'