3
3
- package
4
4
- test-package
5
5
- deploy
6
-
6
+
7
7
# check the code adheres to the coding standards
8
8
static :
9
9
stage : test
@@ -21,7 +21,7 @@ c++-test:
21
21
stage : test
22
22
image : python:3.9
23
23
allow_failure : false
24
- before_script : # install this project's dependencies
24
+ before_script : # install this project's dependencies
25
25
- apt update && apt install gfortran g++ cmake --yes
26
26
script :
27
27
- mkdir build && cd build
@@ -33,25 +33,69 @@ c++-test:
33
33
- ./optgra-test
34
34
35
35
# check the python code compiles and the tests run
36
- test :
36
+ test-py3.9 :
37
37
stage : test
38
38
image : python:3.9
39
39
allow_failure : false
40
- before_script : # install this project's dependencies
40
+ before_script : # install this project's dependencies
41
41
- apt update && apt install gfortran --yes
42
+ - git submodule update --init --recursive # Ensure submodules are updated
42
43
script :
43
44
- python -m pip install .
44
45
- pip install pytest-cov coverage
45
46
- cd tests/python # move into test directory to ensure that the installed package is tested, not the source
46
47
- pytest --cov pyoptgra --cov-report term-missing test.py
47
48
- coverage report --fail-under=95
48
49
50
+ test-py3.10 :
51
+ stage : test
52
+ image : python:3.10
53
+ allow_failure : false
54
+ before_script : # install this project's dependencies
55
+ - apt update && apt install gfortran --yes
56
+ - git submodule update --init --recursive # Ensure submodules are updated
57
+ script :
58
+ - python -m pip install .
59
+ - pip install pytest-cov coverage
60
+ - cd tests/python # move into test directory to ensure that the installed package is tested, not the source
61
+ - pytest --cov pyoptgra --cov-report term-missing test.py
62
+ - coverage report --fail-under=95
63
+
64
+ test-py3.11 :
65
+ stage : test
66
+ image : python:3.11
67
+ allow_failure : false
68
+ before_script : # install this project's dependencies
69
+ - apt update && apt install gfortran --yes
70
+ - git submodule update --init --recursive # Ensure submodules are updated
71
+ script :
72
+ - python -m pip install .
73
+ - pip install pytest-cov coverage
74
+ - cd tests/python # move into test directory to ensure that the installed package is tested, not the source
75
+ - pytest --cov pyoptgra --cov-report term-missing test.py
76
+ - coverage report --fail-under=95
77
+
78
+ # test-py3.12:
79
+ # stage: test
80
+ # image: python:3.12
81
+ # allow_failure: false
82
+ # before_script: # install this project's dependencies
83
+ # - apt update && apt install gfortran --yes
84
+ # - git submodule update --init --recursive # Ensure submodules are updated
85
+ # script:
86
+ # - python -m pip install .
87
+ # - pip install pytest-cov coverage
88
+ # - cd tests/python # move into test directory to ensure that the installed package is tested, not the source
89
+ # - pytest --cov pyoptgra --cov-report term-missing test.py
90
+ # - coverage report --fail-under=95
91
+ # when: manual # Once Pygmo is available for Python 3.12 on pip, this job should work
92
+
49
93
# check the documentation examples work
50
94
doctest :
51
95
stage : test
52
96
image : python:3.9
53
97
allow_failure : false
54
- before_script : # install this project's dependencies
98
+ before_script : # install this project's dependencies
55
99
- apt update && apt install gfortran --yes
56
100
- pip install sphinx breathe
57
101
script :
@@ -64,7 +108,7 @@ documentation:
64
108
stage : test
65
109
image : python:3.9
66
110
allow_failure : false
67
- before_script : # install this project's dependencies
111
+ before_script : # install this project's dependencies
68
112
- apt update && apt install gfortran doxygen --yes
69
113
- pip install sphinx breathe sphinx-rtd-theme
70
114
script :
@@ -74,53 +118,52 @@ documentation:
74
118
- cd ../sphinx
75
119
- make html
76
120
artifacts :
77
- paths :
78
- - doc/sphinx/_build
121
+ paths :
122
+ - doc/sphinx/_build
79
123
80
124
python-sdist :
81
125
stage : package
82
126
image : python:3.9
83
- needs : []
84
127
before_script :
85
128
- apt update && apt install gfortran doxygen --yes
86
129
- pip install --upgrade pip
87
- - pip install scikit-build setuptools-scm ninja cmake
130
+ - pip install build scikit-build setuptools-scm ninja cmake
88
131
script :
89
132
- git submodule update --init --recursive
90
- - python3 setup.py sdist
133
+ - python -m build -- sdist
91
134
- mv dist/pyoptgra-*.tar.gz .
92
135
artifacts :
93
136
name : python-package
94
137
paths :
95
138
- pyoptgra-*.tar.gz
96
139
97
- python-wheels:manylinux2010 :
140
+ python-wheels:manylinux2014 :
98
141
stage : package
99
- image : quay.io/pypa/manylinux2010_x86_64 :latest
142
+ image : quay.io/pypa/manylinux2014_x86_64 :latest # Updated to manylinux2014
100
143
needs : []
101
144
variables :
102
145
GIT_SUBMODULE_STRATEGY : recursive
103
146
script :
104
147
- ./tools/build-manylinux-wheels.sh
105
148
- mv /wheelhouse/repaired/*.whl .
106
149
artifacts :
107
- name : python-wheels-manylinux2010
150
+ name : python-wheels-manylinux2014
108
151
paths :
109
152
- pyoptgra-*.whl
110
153
111
154
test-wheels :
112
155
stage : test-package
113
156
image : python:3.9
114
157
script :
115
- - pip install pyoptgra*cp39-cp39*manylinux2010_x86_64 .whl
158
+ - pip install pyoptgra*cp39-cp39*manylinux2014_x86_64 .whl
116
159
- mkdir test-install
117
160
- cd test-install
118
161
- python -c "import pyoptgra"
119
162
- cd ..
120
163
needs :
121
- - python-wheels:manylinux2010
164
+ - python-wheels:manylinux2014
122
165
123
- publish :
166
+ publish-test :
124
167
stage : deploy
125
168
image : python:3.9
126
169
script :
@@ -132,10 +175,29 @@ publish:
132
175
needs :
133
176
- python-sdist
134
177
- test-wheels
135
- - python-wheels:manylinux2010
178
+ - python-wheels:manylinux2014
179
+ only :
180
+ refs :
181
+ - master
182
+ when : manual
183
+
184
+ # Upload to PyPI after successful tests and package creation
185
+ publish-pypi :
186
+ stage : deploy
187
+ image : python:3.9
188
+ script :
189
+ - pip install twine
190
+ # upload to the project pypi (whl) (change testpypi to pypi to upload to PyPi)
191
+ - twine upload --non-interactive --disable-progress-bar --verbose --repository pypi -u __token__ -p $PYPI_TOKEN pyoptgra-*.whl
192
+ # upload to the project pypi (sdist)
193
+ - twine upload --non-interactive --disable-progress-bar --verbose --repository pypi -u __token__ -p $PYPI_TOKEN pyoptgra-*.tar.gz
194
+ needs :
195
+ - python-sdist
196
+ - test-wheels
197
+ - python-wheels:manylinux2014
136
198
only :
137
199
refs :
138
- - master
200
+ - master
139
201
when : manual
140
202
141
203
pages :
@@ -145,14 +207,13 @@ pages:
145
207
- documentation
146
208
- test-wheels
147
209
script :
148
- - mkdir -p ./public/html/
149
- - mv ./doc/sphinx/_build/html/* ./public/
210
+ - mkdir -p ./public/html/
211
+ - mv ./doc/sphinx/_build/html/* ./public/
150
212
artifacts :
151
213
paths :
152
- - public
153
- - doc/sphinx/_build
214
+ - public
215
+ - doc/sphinx/_build
154
216
only :
155
217
refs :
156
- - master
218
+ - master
157
219
when : manual
158
-
0 commit comments