-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
177 lines (176 loc) · 5.78 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
variables:
CIBW_SKIP: pp* *_i686 *-win32 *musllinux*
CIBW_TEST_REQUIRES: --index-url https://pypi.ampl.com --extra-index-url https://pypi.org/simple amplpy ampl_module_base pandas
CIBW_ENVIRONMENT_PASS_LINUX: AMPLKEY_UUID
CIBW_ARCHS_MACOS: x86_64 universal2
stages:
- stage: build
jobs:
- job: linux
pool: {vmImage: 'ubuntu-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
cplex:
solver: 'cplex'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_TEST_COMMAND: python -m amplpy_copt.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
# - script: |
# sudo apt-get install swig
# displayName: Install SWIG
- bash: |
bash libs/download.sh
displayName: Download libraries
- bash: |
python -m pip install setuptools
set -ex
mkdir -p tmp
TMP=`pwd`/tmp
cp support/twine.sh $WHEELHOUSE/twine.sh
cd python/$SOLVER
bash prepare.sh linux64
bash swig.sh
pip install --upgrade pip
pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==2.21.3
cibuildwheel --platform linux --output-dir $TMP .
ls -l $TMP
test "$(ls -A $TMP)" || exit 1
mv $TMP/* $WHEELHOUSE/
bash prepare.sh # to package libs for all platforms
python setup.py sdist -d $WHEELHOUSE
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- job: macos
pool: {vmImage: 'macOS-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
cplex:
solver: 'cplex'
CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_TEST_COMMAND: python -m amplpy_copt.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
- script: |
brew install swig
displayName: Install SWIG
- bash: |
bash libs/download.sh
displayName: Download libraries
- bash: |
set -ex
mkdir -p tmp
TMP=`pwd`/tmp
cd python/$SOLVER
bash prepare.sh osx64
bash swig.sh
pip install --upgrade pip
pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==2.21.3
cibuildwheel --platform macos --output-dir $TMP .
ls -l $TMP
test "$(ls -A $TMP)" || exit 1
mv $TMP/* $WHEELHOUSE/
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
MACOSX_DEPLOYMENT_TARGET: '10.15'
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- job: windows
pool: {vmImage: 'windows-latest'}
strategy:
matrix:
gurobi:
solver: 'gurobi'
CIBW_TEST_COMMAND: python -m amplpy_gurobi.tests
cplex:
solver: 'cplex'
CIBW_TEST_COMMAND: python -m amplpy_cplex.tests
xpress:
solver: 'xpress'
CIBW_TEST_COMMAND: python -m amplpy_xpress.tests
copt:
solver: 'copt'
CIBW_TEST_COMMAND: python -m amplpy_copt.tests
# highs:
# solver: 'highs'
# CIBW_TEST_COMMAND: python -m amplpy_highs.tests
variables:
wheelhouse: $(Build.ArtifactStagingDirectory)
steps:
- task: UsePythonVersion@0
# - script: |
# choco install vcpython27 -f -y
# displayName: Install Visual C++ for Python 2.7
# - script: |
# choco install -y --x86 swig
# displayName: Install SWIG
- bash: |
bash libs/download.sh
displayName: Download libraries
- bash: |
set -ex
mkdir -p tmp
cd python/$SOLVER
bash prepare.sh win64
bash swig.sh
python -m pip install --user --upgrade pip
python -m pip install urllib3[secure] --upgrade
python -m pip install --upgrade cibuildwheel==2.21.3
cibuildwheel --platform windows --output-dir tmp .
cp tmp/* $WHEELHOUSE/
env:
CIBW_ENVIRONMENT: AMPLKEY_UUID=$(AMPLKEY_UUID)
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: '$(Build.ArtifactStagingDirectory)'}
- stage: publish
jobs:
- job: upload
pool: {vmImage: 'ubuntu-latest'}
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadPath: 'artifacts/ampls-api'
artifactName: 'drop'
displayName: 'Download current pipeline artifacts'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'artifacts/'
artifact: 'release'
artifactType: 'pipeline'