-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from pyswmm/dev
- Loading branch information
Showing
16 changed files
with
282 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Build Wheels | ||
|
||
# Cross compile wheels only on main branch and tags | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_nrtest_plugin: | ||
name: Build nrtest-swmm plugin | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./nrtest-swmm | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Build wheel | ||
run: | | ||
pip install wheel | ||
python setup.py bdist_wheel | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: nrtest-swmm/dist/*.whl | ||
|
||
|
||
|
||
build_wheels: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-2022, macos-12] | ||
pyver: [cp38, cp39, cp310, cp311] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: ./swmm-toolkit | ||
env: | ||
CIBW_TEST_COMMAND: "pytest {package}/tests" | ||
CIBW_BEFORE_TEST: pip install -r {package}/test-requirements.txt | ||
# mac needs ninja to build | ||
CIBW_BEFORE_BUILD_MACOS: brew install ninja | ||
# configure cibuildwheel to build native archs ('auto'), and some emulated ones | ||
CIBW_ARCHS_LINUX: x86_64 | ||
CIBW_ARCHS_WINDOWS: AMD64 | ||
CIBW_ARCHS_MACOS: x86_64 | ||
# only build current supported python: https://devguide.python.org/versions/ | ||
# don't build pypy or musllinux to save build time. TODO: find a good way to support those archs | ||
CIBW_BUILD: ${{matrix.pyver}}-* | ||
CIBW_SKIP: cp36-* cp37-* cp312-* pp* *-musllinux* | ||
# Will avoid testing on emulated architectures | ||
# Skip trying to test arm64 builds on Intel Macs | ||
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64 *-macosx_universal2:arm64" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_cross_wheels: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest,macos-12] | ||
pyver: [cp38, cp39, cp310, cp311] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: ./swmm-toolkit | ||
env: | ||
# mac needs ninja to build | ||
CIBW_BEFORE_BUILD_MACOS: brew install ninja | ||
# configure cibuildwheel to build native archs ('auto'), and some emulated ones | ||
CIBW_ARCHS_LINUX: aarch64 | ||
CIBW_ARCHS_MACOS: arm64 | ||
# only build current supported python: https://devguide.python.org/versions/ | ||
# don't build pypy or musllinux to save build time. TODO: find a good way to support those archs | ||
CIBW_BUILD: ${{matrix.pyver}}-* | ||
CIBW_SKIP: cp36-* cp37-* cp312-* pp* *-musllinux* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Unit Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'master' | ||
tags-ignore: | ||
- v* | ||
pull_request: | ||
branches-ignore: | ||
- 'master' | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
working-directory: ./swmm-toolkit | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-2022, macos-12, ubuntu-latest] | ||
include: | ||
- os: windows-2022 | ||
sys_pkgs: choco install swig | ||
activate: ./build-env/Scripts/activate | ||
|
||
- os: macos-12 | ||
sys_pkgs: brew install swig ninja | ||
activate: source ./build-env/bin/activate | ||
|
||
- os: ubuntu-latest | ||
activate: source ./build-env/bin/activate | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install required system packages | ||
run: ${{matrix.sys_pkgs}} | ||
|
||
- name: Build wheel in virtual env | ||
run: | | ||
python -m venv --clear ./build-env | ||
${{matrix.activate}} | ||
python -m pip install -r build-requirements.txt | ||
python setup.py bdist_wheel | ||
deactivate | ||
- name: Test wheel | ||
run: | | ||
pip install -r test-requirements.txt | ||
pip install --no-index --find-links=./dist swmm_toolkit | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.