Skip to content

Commit f03feb0

Browse files
committed
ci: Refactor azure pipeline configuration
Move the current jobs under `Analyse&Test` stage.
1 parent 0fd7791 commit f03feb0

File tree

1 file changed

+152
-149
lines changed

1 file changed

+152
-149
lines changed

azure-pipelines.yml

Lines changed: 152 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,157 @@
1-
jobs:
2-
-
3-
job: code_style_check
1+
stages:
2+
- stage: AnalyseTest
3+
displayName: 'Analyse and Test'
4+
jobs:
5+
- job: code_style_check
6+
47
pool:
5-
vmImage: ubuntu-16.04
8+
vmImage: ubuntu-16.04
9+
610
steps:
7-
-
8-
task: UsePythonVersion@0
9-
inputs:
10-
versionSpec: "3.7"
11-
architecture: x64
12-
-
13-
script: pip install --user flake8==3.7.3
14-
displayName: "Install flake8"
15-
-
16-
script: python -m flake8
17-
displayName: "Run flake8"
18-
-
19-
job: test
11+
- task: UsePythonVersion@0
12+
inputs:
13+
versionSpec: "3.7"
14+
architecture: x64
15+
- script: pip install --user flake8==3.7.3
16+
displayName: "Install flake8"
17+
18+
- script: python -m flake8
19+
displayName: "Run flake8"
20+
21+
- job: test
2022
strategy:
21-
matrix:
22-
linux_python_2_7:
23-
python.version: "2.7"
24-
imageName: ubuntu-16.04
25-
sendCoverage: "false"
26-
linux_python_3_5:
27-
python.version: "3.5"
28-
imageName: ubuntu-16.04
29-
sendCoverage: "false"
30-
linux_python_3_6:
31-
python.version: "3.6"
32-
imageName: ubuntu-16.04
33-
sendCoverage: "false"
34-
linux_python_3_7:
35-
python.version: "3.7"
36-
imageName: ubuntu-16.04
37-
sendCoverage: "false"
38-
linux_python_3_8:
39-
python.version: "3.8"
40-
imageName: ubuntu-16.04
41-
sendCoverage: "true"
42-
mac_python_2_7:
43-
python.version: "2.7"
44-
imageName: macOS-10.15
45-
sendCoverage: "false"
46-
mac_python_3_5:
47-
python.version: "3.5"
48-
imageName: macOS-10.15
49-
sendCoverage: "false"
50-
mac_python_3_6:
51-
python.version: "3.6"
52-
imageName: macOS-10.15
53-
sendCoverage: "false"
54-
mac_python_3_7:
55-
python.version: "3.7"
56-
imageName: macOS-10.15
57-
sendCoverage: "false"
58-
mac_python_3_8:
59-
python.version: "3.8"
60-
imageName: macOS-10.15
61-
sendCoverage: "false"
62-
windows_python_2_7:
63-
python.version: "2.7"
64-
imageName: vs2017-win2016
65-
sendCoverage: "false"
66-
windows_python_3_5:
67-
python.version: "3.5"
68-
imageName: vs2017-win2016
69-
sendCoverage: "false"
70-
windows_python_3_6:
71-
python.version: "3.6"
72-
imageName: vs2017-win2016
73-
sendCoverage: "false"
74-
windows_python_3_7:
75-
python.version: "3.7"
76-
imageName: vs2017-win2016
77-
sendCoverage: "false"
78-
windows_python_3_8:
79-
python.version: "3.8"
80-
imageName: vs2017-win2016
81-
sendCoverage: "false"
82-
maxParallel: 10
23+
maxParallel: 10
24+
matrix:
25+
linux_python_2_7:
26+
python.version: "2.7"
27+
imageName: ubuntu-16.04
28+
sendCoverage: "false"
29+
linux_python_3_5:
30+
python.version: "3.5"
31+
imageName: ubuntu-16.04
32+
sendCoverage: "false"
33+
linux_python_3_6:
34+
python.version: "3.6"
35+
imageName: ubuntu-16.04
36+
sendCoverage: "false"
37+
linux_python_3_7:
38+
python.version: "3.7"
39+
imageName: ubuntu-16.04
40+
sendCoverage: "false"
41+
linux_python_3_8:
42+
python.version: "3.8"
43+
imageName: ubuntu-16.04
44+
sendCoverage: "true"
45+
mac_python_2_7:
46+
python.version: "2.7"
47+
imageName: macOS-10.15
48+
sendCoverage: "false"
49+
mac_python_3_5:
50+
python.version: "3.5"
51+
imageName: macOS-10.15
52+
sendCoverage: "false"
53+
mac_python_3_6:
54+
python.version: "3.6"
55+
imageName: macOS-10.15
56+
sendCoverage: "false"
57+
mac_python_3_7:
58+
python.version: "3.7"
59+
imageName: macOS-10.15
60+
sendCoverage: "false"
61+
mac_python_3_8:
62+
python.version: "3.8"
63+
imageName: macOS-10.15
64+
sendCoverage: "false"
65+
windows_python_2_7:
66+
python.version: "2.7"
67+
imageName: vs2017-win2016
68+
sendCoverage: "false"
69+
windows_python_3_5:
70+
python.version: "3.5"
71+
imageName: vs2017-win2016
72+
sendCoverage: "false"
73+
windows_python_3_6:
74+
python.version: "3.6"
75+
imageName: vs2017-win2016
76+
sendCoverage: "false"
77+
windows_python_3_7:
78+
python.version: "3.7"
79+
imageName: vs2017-win2016
80+
sendCoverage: "false"
81+
windows_python_3_8:
82+
python.version: "3.8"
83+
imageName: vs2017-win2016
84+
sendCoverage: "false"
85+
8386
pool:
84-
vmImage: $(imageName)
87+
vmImage: $(imageName)
88+
8589
steps:
86-
-
87-
task: UsePythonVersion@0
88-
inputs:
89-
versionSpec: $(python.version)
90-
architecture: x64
91-
-
92-
script: "python -m pip install --upgrade pip && pip install -r test_requirements.txt"
93-
displayName: "Install mbed-os test dependencies"
94-
-
95-
script: "pip install lxml"
96-
env: { STATIC_DEPS: true }
97-
displayName: "Install lxml separately on Linux/MacOS"
98-
-
99-
script: 'pip install --user "urllib3<1.25"'
100-
displayName: "Fix dependency issue for requests package"
101-
-
102-
script: "python -m coverage run setup.py test"
103-
displayName: "Test mbed-os-tools"
104-
-
105-
bash: "python setup.py sdist && pip install dist/*"
106-
displayName: "Install mbed-os-tools"
107-
-
108-
bash: "python setup.py sdist && pip install dist/*"
109-
displayName: "Install mbed-ls"
110-
workingDirectory: "packages/mbed-ls"
111-
-
112-
bash: "python setup.py sdist && pip install dist/*"
113-
displayName: "Install mbed-host-tests"
114-
workingDirectory: "packages/mbed-host-tests"
115-
-
116-
bash: "python setup.py sdist && pip install dist/*"
117-
displayName: "Install mbed-greentea"
118-
workingDirectory: "packages/mbed-greentea"
119-
-
120-
script: "python -m coverage run setup.py test"
121-
displayName: "Test mbed-ls"
122-
workingDirectory: "packages/mbed-ls"
123-
-
124-
script: "python -m coverage run setup.py test"
125-
displayName: "Test mbed-host-tests"
126-
workingDirectory: "packages/mbed-host-tests"
127-
-
128-
script: "python -m coverage run setup.py test"
129-
displayName: "Test mbed-greentea"
130-
workingDirectory: "packages/mbed-greentea"
131-
-
132-
script: |
133-
python -m coverage combine .coverage packages/*/.coverage
134-
python -m coveralls
135-
condition: eq(variables['sendCoverage'], 'true')
136-
displayName: "Send coverage results to coveralls"
137-
-
138-
script: "pip uninstall -y mbed-os-tools mbed-ls mbed-greentea mbed-host-tests"
139-
displayName: "Uninstall sdist packages"
140-
-
141-
script: "pip install ."
142-
displayName: "Ensure mbed-os-tools can be installed locally for development"
143-
-
144-
script: "pip install ."
145-
displayName: "Ensure mbed-ls can be installed locally for development"
146-
workingDirectory: "packages/mbed-ls"
147-
-
148-
script: "pip install ."
149-
displayName: "Ensure mbed-host-tests can be installed locally for development"
150-
workingDirectory: "packages/mbed-host-tests"
151-
-
152-
script: "pip install ."
153-
displayName: "Ensure mbed-greentea can be installed locally for development"
154-
workingDirectory: "packages/mbed-greentea"
90+
- task: UsePythonVersion@0
91+
inputs:
92+
versionSpec: $(python.version)
93+
architecture: x64
94+
95+
- script: "python -m pip install --upgrade pip && pip install -r test_requirements.txt"
96+
displayName: "Install mbed-os test dependencies"
97+
98+
- script: "pip install lxml"
99+
env: { STATIC_DEPS: true }
100+
displayName: "Install lxml separately on Linux/MacOS"
101+
102+
- script: 'pip install --user "urllib3<1.25"'
103+
displayName: "Fix dependency issue for requests package"
104+
105+
- script: "python -m coverage run setup.py test"
106+
displayName: "Test mbed-os-tools"
107+
108+
- bash: "python setup.py sdist && pip install dist/*"
109+
displayName: "Install mbed-os-tools"
110+
111+
- bash: "python setup.py sdist && pip install dist/*"
112+
displayName: "Install mbed-ls"
113+
workingDirectory: "packages/mbed-ls"
114+
115+
- bash: "python setup.py sdist && pip install dist/*"
116+
displayName: "Install mbed-host-tests"
117+
workingDirectory: "packages/mbed-host-tests"
118+
119+
- bash: "python setup.py sdist && pip install dist/*"
120+
displayName: "Install mbed-greentea"
121+
workingDirectory: "packages/mbed-greentea"
122+
123+
- script: "python -m coverage run setup.py test"
124+
displayName: "Test mbed-ls"
125+
workingDirectory: "packages/mbed-ls"
126+
127+
- script: "python -m coverage run setup.py test"
128+
displayName: "Test mbed-host-tests"
129+
workingDirectory: "packages/mbed-host-tests"
130+
131+
- script: "python -m coverage run setup.py test"
132+
displayName: "Test mbed-greentea"
133+
workingDirectory: "packages/mbed-greentea"
134+
135+
- script: |
136+
python -m coverage combine .coverage packages/*/.coverage
137+
python -m coveralls
138+
condition: eq(variables['sendCoverage'], 'true')
139+
displayName: "Send coverage results to coveralls"
140+
141+
- script: "pip uninstall -y mbed-os-tools mbed-ls mbed-greentea mbed-host-tests"
142+
displayName: "Uninstall sdist packages"
143+
144+
- script: "pip install ."
145+
displayName: "Ensure mbed-os-tools can be installed locally for development"
146+
147+
- script: "pip install ."
148+
displayName: "Ensure mbed-ls can be installed locally for development"
149+
workingDirectory: "packages/mbed-ls"
150+
151+
- script: "pip install ."
152+
displayName: "Ensure mbed-host-tests can be installed locally for development"
153+
workingDirectory: "packages/mbed-host-tests"
154+
155+
- script: "pip install ."
156+
displayName: "Ensure mbed-greentea can be installed locally for development"
157+
workingDirectory: "packages/mbed-greentea"

0 commit comments

Comments
 (0)