Skip to content

Commit 5e12aa5

Browse files
committed
Add multiarch in basemap workflow
1 parent 02ddaf8 commit 5e12aa5

File tree

1 file changed

+61
-37
lines changed

1 file changed

+61
-37
lines changed

.github/workflows/ci-basemap.yml

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ on:
1010
jobs:
1111

1212
build-geos:
13+
strategy:
14+
matrix:
15+
arch:
16+
[
17+
"i386",
18+
"amd64",
19+
]
20+
max-parallel: 6
21+
fail-fast: false
1322
runs-on: ubuntu-latest
14-
container: "tinybases/python:3.6-debian-4"
23+
container: "tinybases/${{matrix.arch}}-python:3.6-debian-4"
1524
steps:
1625
-
1726
name: Checkout
@@ -43,21 +52,24 @@ jobs:
4352
run: |
4453
set -e
4554
. /etc/profile
46-
cd ${{ env.PKGDIR }}
55+
cd ${{env.PKGDIR}}
4756
export MAKEFLAGS="-j 16"
4857
python -c "import utils; utils.GeosLibrary('3.3.3').build('extern')"
4958
-
5059
name: Upload GEOS artifacts
5160
uses: actions/upload-artifact@v1
5261
with:
53-
name: artifacts-geos
54-
path: ${{ env.PKGDIR }}/extern
62+
name: artifacts-geos-${{matrix.arch}}
63+
path: ${{env.PKGDIR}}/extern
5564

5665
build:
57-
needs: build-geos
58-
runs-on: ubuntu-latest
5966
strategy:
6067
matrix:
68+
arch:
69+
[
70+
"i386",
71+
"amd64",
72+
]
6173
python_version:
6274
[
6375
"2.7",
@@ -69,7 +81,9 @@ jobs:
6981
]
7082
max-parallel: 6
7183
fail-fast: false
72-
container: "tinybases/python:${{ matrix.python_version }}-debian-4"
84+
needs: build-geos
85+
runs-on: ubuntu-latest
86+
container: "tinybases/${{matrix.arch}}-python:${{matrix.python_version}}-debian-4"
7387
steps:
7488
-
7589
name: Checkout
@@ -78,8 +92,8 @@ jobs:
7892
name: Download GEOS artifacts
7993
uses: actions/download-artifact@v1
8094
with:
81-
name: artifacts-geos
82-
path: ${{ env.PKGDIR }}/extern
95+
name: artifacts-geos-${{matrix.arch}}
96+
path: ${{env.PKGDIR}}/extern
8397
-
8498
name: Install GCC toolchain
8599
run: |
@@ -100,7 +114,7 @@ jobs:
100114
run: |
101115
set -e
102116
. /etc/profile
103-
case "${{ matrix.python_version }}" in
117+
case "${{matrix.python_version}}" in
104118
2.[67]|3.[0123456]) pkgvers=1.11.3;;
105119
*) pkgvers=1.16.6;;
106120
esac
@@ -113,14 +127,14 @@ jobs:
113127
python setup.py build -j 16
114128
cp build/src*/numpy/core/include/numpy/*.h numpy/core/include/numpy/
115129
cd ..
116-
cp -R ${pkgcode}/numpy/core/include ${{ env.PKGDIR }}/extern
130+
cp -R ${pkgcode}/numpy/core/include ${{env.PKGDIR}}/extern
117131
rm -rf ${pkgcode}
118132
-
119133
name: Build wheel
120134
run: |
121135
set -e
122136
. /etc/profile
123-
cd ${{ env.PKGDIR }}
137+
cd ${{env.PKGDIR}}
124138
export GEOS_DIR=extern
125139
export NUMPY_INCLUDE_PATH=extern/include
126140
pip install -r requirements-setup.txt
@@ -129,14 +143,17 @@ jobs:
129143
name: Upload build artifacts
130144
uses: actions/upload-artifact@v1
131145
with:
132-
name: artifacts-build-${{ matrix.python_version }}
133-
path: ${{ env.PKGDIR }}/dist
146+
name: artifacts-build-${{matrix.arch}}-${{matrix.python_version}}
147+
path: ${{env.PKGDIR}}/dist
134148

135149
repair:
136-
needs: build
137-
runs-on: ubuntu-latest
138150
strategy:
139151
matrix:
152+
arch:
153+
[
154+
"i386",
155+
"amd64",
156+
]
140157
python_version:
141158
[
142159
"2.7",
@@ -148,7 +165,9 @@ jobs:
148165
]
149166
max-parallel: 6
150167
fail-fast: false
151-
container: "tinybases/python:3.6-debian-5"
168+
needs: build
169+
runs-on: ubuntu-latest
170+
container: "tinybases/${{matrix.arch}}-python:3.6-debian-5"
152171
steps:
153172
-
154173
name: Checkout
@@ -157,14 +176,14 @@ jobs:
157176
name: Download GEOS artifacts
158177
uses: actions/download-artifact@v1
159178
with:
160-
name: artifacts-geos
161-
path: ${{ env.PKGDIR }}/extern
179+
name: artifacts-geos-${{matrix.arch}}
180+
path: ${{env.PKGDIR}}/extern
162181
-
163182
name: Download build artifacts
164183
uses: actions/download-artifact@v1
165184
with:
166-
name: artifacts-build-${{ matrix.python_version }}
167-
path: ${{ env.PKGDIR }}/dist
185+
name: artifacts-build-${{matrix.arch}}-${{matrix.python_version}}
186+
path: ${{env.PKGDIR}}/dist
168187
-
169188
name: Install GCC toolchain
170189
run: |
@@ -219,22 +238,24 @@ jobs:
219238
run: |
220239
set -e
221240
. /etc/profile
222-
cd ${{ env.PKGDIR }}
241+
cd ${{env.PKGDIR}}
223242
export LD_LIBRARY_PATH="$(readlink -f extern/lib)"
224-
auditwheel repair -w dist --plat manylinux1_x86_64 dist/*.whl
243+
auditwheel repair -w dist dist/*.whl
225244
-
226245
name: Upload artifacts
227246
uses: actions/upload-artifact@v1
228247
with:
229-
name: artifacts-build-${{ matrix.python_version }}
230-
path: ${{ env.PKGDIR }}/dist
248+
name: artifacts-build-${{matrix.arch}}-${{matrix.python_version}}
249+
path: ${{env.PKGDIR}}/dist
231250

232251
upload:
233-
if: startsWith(github.event.ref, 'refs/tags/v')
234-
needs: repair
235-
runs-on: ubuntu-latest
236252
strategy:
237253
matrix:
254+
arch:
255+
[
256+
"i386",
257+
"amd64",
258+
]
238259
python_version:
239260
[
240261
"2.7",
@@ -245,7 +266,10 @@ jobs:
245266
"3.9",
246267
]
247268
max-parallel: 1
248-
container: "tinybases/python:${{ matrix.python_version }}-debian-5"
269+
if: startsWith(github.event.ref, 'refs/tags/v')
270+
needs: repair
271+
runs-on: ubuntu-latest
272+
container: "tinybases/${{matrix.arch}}-python:${{matrix.python_version}}-debian-5"
249273
environment: Test PyPI
250274
steps:
251275
-
@@ -255,8 +279,8 @@ jobs:
255279
name: Download build artifacts
256280
uses: actions/download-artifact@v1
257281
with:
258-
name: artifacts-build-${{ matrix.python_version }}
259-
path: ${{ env.PKGDIR }}/dist
282+
name: artifacts-build-${{matrix.arch}}-${{matrix.python_version}}
283+
path: ${{env.PKGDIR}}/dist
260284
-
261285
name: Print environment
262286
run: |
@@ -273,14 +297,14 @@ jobs:
273297
name: Upload distributables
274298
env:
275299
TWINE_USERNAME: __token__
276-
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
277-
TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}"
300+
TWINE_PASSWORD: "${{secrets.PYPI_TOKEN}}"
301+
TWINE_REPOSITORY_URL: "${{secrets.PYPI_REPOSITORY_URL}}"
278302
run: |
279303
set -e
280304
. /etc/profile
281305
python -m twine check \
282-
${{ env.PKGDIR }}/dist/*.tar.gz \
283-
${{ env.PKGDIR }}/dist/*-manylinux1*.whl
306+
${{env.PKGDIR}}/dist/*.tar.gz \
307+
${{env.PKGDIR}}/dist/*-manylinux1*.whl
284308
python -m twine upload --skip-existing \
285-
${{ env.PKGDIR }}/dist/*.tar.gz \
286-
${{ env.PKGDIR }}/dist/*-manylinux1*.whl
309+
${{env.PKGDIR}}/dist/*.tar.gz \
310+
${{env.PKGDIR}}/dist/*-manylinux1*.whl

0 commit comments

Comments
 (0)