1+ name : Build Wheels
2+
3+ # Cross compile wheels only on main branch and tags
4+ on :
5+ pull_request :
6+ branches :
7+ - master
8+ push :
9+ branches :
10+ - master
11+ tags :
12+ - v*
13+ workflow_dispatch :
14+
15+ jobs :
16+ build_nrtest_plugin :
17+ name : Build nrtest-swmm plugin
18+ runs-on : ubuntu-latest
19+ defaults :
20+ run :
21+ working-directory : ./nrtest-swmm
22+
23+ steps :
24+ - name : Checkout repo
25+ uses : actions/checkout@v3
26+ with :
27+ submodules : true
28+
29+ - name : Install Python
30+ uses : actions/setup-python@v4
31+ with :
32+ python-version : 3.7
33+
34+ - name : Build wheel
35+ run : |
36+ pip install wheel
37+ python setup.py bdist_wheel
38+ - uses : actions/upload-artifact@v3
39+ with :
40+ path : nrtest-swmm/dist/*.whl
41+
42+
43+
44+ build_wheels :
45+ runs-on : ${{ matrix.os }}
46+ strategy :
47+ fail-fast : true
48+ matrix :
49+ os : [ubuntu-latest, windows-2022, macos-12]
50+ pyver : [cp38, cp39, cp310, cp311]
51+
52+ steps :
53+ - name : Checkout repo
54+ uses : actions/checkout@v3
55+ with :
56+ submodules : true
57+
58+ - name : Build wheels
59+ 60+ with :
61+ package-dir : ./swmm-toolkit
62+ env :
63+ CIBW_TEST_COMMAND : " pytest {package}/tests"
64+ CIBW_BEFORE_TEST : pip install -r {package}/test-requirements.txt
65+ # mac needs ninja to build
66+ CIBW_BEFORE_BUILD_MACOS : brew install ninja
67+ # configure cibuildwheel to build native archs ('auto'), and some emulated ones
68+ CIBW_ARCHS_LINUX : x86_64
69+ CIBW_ARCHS_WINDOWS : AMD64
70+ CIBW_ARCHS_MACOS : x86_64
71+ # only build current supported python: https://devguide.python.org/versions/
72+ # don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
73+ CIBW_BUILD : ${{matrix.pyver}}-*
74+ CIBW_SKIP : cp36-* cp37-* cp312-* pp* *-musllinux*
75+ # Will avoid testing on emulated architectures
76+ # Skip trying to test arm64 builds on Intel Macs
77+ CIBW_TEST_SKIP : " *-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64 *-macosx_universal2:arm64"
78+
79+ - uses : actions/upload-artifact@v3
80+ with :
81+ path : ./wheelhouse/*.whl
82+
83+ build_cross_wheels :
84+ runs-on : ${{ matrix.os }}
85+ strategy :
86+ fail-fast : true
87+ matrix :
88+ os : [ubuntu-latest,macos-12]
89+ pyver : [cp38, cp39, cp310, cp311]
90+
91+ steps :
92+ - name : Checkout repo
93+ uses : actions/checkout@v3
94+ with :
95+ submodules : true
96+
97+ - name : Set up QEMU
98+ if : runner.os == 'Linux'
99+ uses : docker/setup-qemu-action@v2
100+ with :
101+ platforms : all
102+
103+ - name : Build wheels
104+ 105+ with :
106+ package-dir : ./swmm-toolkit
107+ env :
108+ # mac needs ninja to build
109+ CIBW_BEFORE_BUILD_MACOS : brew install ninja
110+ # configure cibuildwheel to build native archs ('auto'), and some emulated ones
111+ CIBW_ARCHS_LINUX : aarch64
112+ CIBW_ARCHS_MACOS : arm64
113+ # only build current supported python: https://devguide.python.org/versions/
114+ # don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
115+ CIBW_BUILD : ${{matrix.pyver}}-*
116+ CIBW_SKIP : cp36-* cp37-* cp312-* pp* *-musllinux*
117+
118+ - uses : actions/upload-artifact@v3
119+ with :
120+ path : ./wheelhouse/*.whl
0 commit comments