Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8efc1d

Browse files
committed
Python: Check code format and build wheels in CI
1 parent 478c128 commit d8efc1d

File tree

1 file changed

+97
-13
lines changed

1 file changed

+97
-13
lines changed

azure-pipelines.yml

Lines changed: 97 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,101 @@
1-
# Starter pipeline
2-
# Start with a minimal pipeline that you can customize to build and deploy your code.
3-
# Add steps that build, run tests, deploy, and more:
4-
# https://aka.ms/yaml
1+
variables:
2+
CIBW_BEFORE_BUILD: pip install pybind11==2.4.3
3+
CIBW_SKIP: cp27-win*
54

6-
trigger:
7-
- master
5+
jobs:
6+
- job: unit_linux
7+
pool: { vmImage: "ubuntu-latest" }
8+
steps:
9+
- script: |
10+
cd tests
11+
make && ./tester
12+
displayName: Run unit tests
13+
14+
- job: python_linux
15+
pool: { vmImage: "Ubuntu-16.04" }
16+
steps:
17+
- task: UsePythonVersion@0
18+
- bash: |
19+
# Make the header files available to the build.
20+
cp *.h python
21+
python -m pip install --upgrade pip
22+
pip install cibuildwheel==0.12.0
23+
cd python
24+
cibuildwheel --output-dir wheelhouse .
25+
- task: PublishBuildArtifacts@1
26+
inputs: { pathtoPublish: "python/wheelhouse" }
27+
- script: |
28+
pip install black==19.10b0
29+
black --check python/
30+
displayName: Check Python code format
831
9-
pool:
10-
vmImage: 'ubuntu-latest'
32+
- job: python_macos
33+
pool: { vmImage: "macOS-10.13" }
34+
variables:
35+
# Support C++11: https://github.com/joerick/cibuildwheel/pull/156
36+
MACOSX_DEPLOYMENT_TARGET: 10.9
37+
steps:
38+
- task: UsePythonVersion@0
39+
- bash: |
40+
# Make the header files available to the build.
41+
cp *.h python
42+
python -m pip install --upgrade pip
43+
pip install cibuildwheel==0.12.0
44+
cd python
45+
cibuildwheel --output-dir wheelhouse .
46+
- task: PublishBuildArtifacts@1
47+
inputs: { pathtoPublish: "python/wheelhouse" }
1148

12-
steps:
49+
- job: python_windows
50+
pool: { vmImage: "vs2017-win2016" }
51+
steps:
52+
- {
53+
task: UsePythonVersion@0,
54+
inputs: { versionSpec: "2.7", architecture: x86 },
55+
}
56+
- {
57+
task: UsePythonVersion@0,
58+
inputs: { versionSpec: "2.7", architecture: x64 },
59+
}
60+
- {
61+
task: UsePythonVersion@0,
62+
inputs: { versionSpec: "3.5", architecture: x86 },
63+
}
64+
- {
65+
task: UsePythonVersion@0,
66+
inputs: { versionSpec: "3.5", architecture: x64 },
67+
}
68+
- {
69+
task: UsePythonVersion@0,
70+
inputs: { versionSpec: "3.6", architecture: x86 },
71+
}
72+
- {
73+
task: UsePythonVersion@0,
74+
inputs: { versionSpec: "3.6", architecture: x64 },
75+
}
76+
- {
77+
task: UsePythonVersion@0,
78+
inputs: { versionSpec: "3.7", architecture: x86 },
79+
}
80+
- {
81+
task: UsePythonVersion@0,
82+
inputs: { versionSpec: "3.7", architecture: x64 },
83+
}
84+
- script: choco install vcpython27 -f -y
85+
displayName: Install Visual C++ for Python 2.7
86+
- bash: |
87+
cp *.h python
88+
python -m pip install --upgrade pip
89+
pip install cibuildwheel==0.12.0
90+
cd python
91+
cibuildwheel --output-dir wheelhouse .
92+
- task: PublishBuildArtifacts@1
93+
inputs: { pathtoPublish: "python/wheelhouse" }
94+
95+
trigger:
96+
- master
1397

14-
- script: |
15-
cd tests
16-
make && ./tester
17-
displayName: 'Run unit tests'
98+
pr:
99+
branches:
100+
include:
101+
- "*"

0 commit comments

Comments
 (0)