77 branches : [ master]
88
99env :
10- BUILD_TYPE : Release
1110 VCPKG_ROOT : ${{ github.workspace }}/vcpkg
1211 VCPKG_EXE : ${{ github.workspace }}/vcpkg/vcpkg
13- NUGET_FEED_URL : https://nuget.pkg.github.com/USEPA/index.json
1412 VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
1513 OMP_NUM_THREADS : 1
16- BUILD_HOME : build
17- NUGET_USER_NAME : ${{ secrets.CALEB_NUGET_USER_NAME }}
18- NUGET_API_KEY : ${{ secrets.GITHUB_TOKEN }}
19-
2014jobs :
2115 engine_unit_test :
22- name : Build and Unit Testing of Engine
16+ name : Build and Unit Test C/C++ Engine
2317 permissions : write-all
2418 strategy :
2519 fail-fast : false
2620 matrix :
27- os : [windows-latest] # , ubuntu-latest, macos-13, macos-latest]
21+ os : [windows-latest, ubuntu-latest, macos-13, macos-latest]
2822 include :
29- # - os: ubuntu-latest
30- # alias: Linux
31- # shell: bash
32- # cmake_preset: Linux
33- # shell_extension: .sh
34- # vcpkg_triplet: x64-linux
35-
36- # - os: macos-13
37- # alias: intel-mac
38- # cmake_preset: Darwin
39- # shell: bash
40- # shell_extension: .sh
41- # vcpkg_triplet: x64-osx
42-
43- # - os: macos-latest
44- # alias: apple-silicon
45- # cmake_preset: Darwin
46- # shell: bash
47- # shell_extension: .sh
48- # vcpkg_triplet: arm64-osx
23+ - os : ubuntu-latest
24+ alias : Linux
25+ shell : bash
26+ cmake_preset : Linux
27+ shell_extension : .sh
28+ vcpkg_triplet : x64-linux
29+
30+ - os : macos-13
31+ alias : intel-mac
32+ cmake_preset : Darwin
33+ shell : bash
34+ shell_extension : .sh
35+ vcpkg_triplet : x64-osx
36+
37+ - os : macos-latest
38+ alias : apple-silicon
39+ cmake_preset : Darwin
40+ shell : bash
41+ shell_extension : .sh
42+ vcpkg_triplet : arm64-osx
4943
5044 - os : windows-latest
5145 alias : win64
@@ -65,11 +59,10 @@ jobs:
6559 repository : microsoft/vcpkg
6660 ref : 2025.02.14
6761 path : vcpkg
68-
69- - name : Install OpenMP on MacOS
62+
63+ - name : Install OpenMP ( MacOS)
7064 if : ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-13' }}
7165 run : |
72- # brew reinstall --build-from-source libomp
7366 brew reinstall libomp
7467 brew link --force --overwrite libomp
7568
@@ -94,22 +87,15 @@ jobs:
9487 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
9588 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
9689
97- - name : Install Required Libraries (Windows)
98- if : ${{ matrix.os == 'windows-latest' }}
99- run : |
100- ${{ env.VCPKG_EXE }} install
101-
10290 - name : Build Binaries
103- env :
104- VCPKG_ROOT : ${{ env.VCPKG_ROOT }}
10591 run : |
106- cmake -B build- ${{ matrix.vcpkg_triplet }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON --preset= ${{ matrix.cmake_preset }}
107- cmake --build build-${{ matrix.vcpkg_triplet }} --target package
108-
92+ cmake --preset= ${{ matrix.cmake_preset }}-debug -B build- ${{ matrix.vcpkg_triplet }} -DBUILD_TESTS=ON
93+ cmake --build build-${{ matrix.vcpkg_triplet }} --target package
94+
10995 - name : Unit Test
110- run : ctest --test-dir build-${{ matrix.vcpkg_triplet }} -C Debug --output-on-failure
96+ run : |
97+ ctest --test-dir ./build-${{ matrix.vcpkg_triplet }} -C Debug --output-on-failure
11198
112-
11399 - name : Upload Artifacts
114100 if : ${{ always() }}
115101 uses : actions/upload-artifact@v4
@@ -118,17 +104,23 @@ jobs:
118104 path : |
119105 build-${{ matrix.vcpkg_triplet }}/*.tar.gz
120106 build-${{ matrix.vcpkg_triplet }}/*.zip
121- build-${{ matrix.vcpkg_triplet }}/*.nupkg
122-
123107
124108 python_binding_unit_test :
125- name : Build and Unit Test and Python Bindings
126- needs : engine_unit_test
109+ name : Build and Unit Test Python Bindings
127110 strategy :
111+ fail-fast : false
128112 matrix :
129113 os : [windows-latest, ubuntu-latest, macos-13, macos-latest]
130114 python : [3.13]
131115 include :
116+
117+ - os : windows-latest
118+ alias : win64
119+ cmake_preset : Windows
120+ shell : cmd
121+ shell_extension : .bat
122+ vcpkg_triplet : x64-windows
123+
132124 - os : ubuntu-latest
133125 alias : Linux
134126 shell : bash
@@ -150,22 +142,50 @@ jobs:
150142 shell_extension : .sh
151143 vcpkg_triplet : arm64-osx
152144
153- - os : windows-latest
154- alias : win64
155- cmake_preset : Windows
156- shell : cmd
157- shell_extension : .bat
158- vcpkg_triplet : x64-windows
159-
160145 runs-on : ${{ matrix.os }}
161146 defaults :
162147 run :
163148 shell : ${{ matrix.shell }}
164149
165150 steps :
166- # - name: Checkout SWMM Repo
167- # uses: actions/checkout@v4
151+ - name : Checkout SWMM Repo
152+ uses : actions/checkout@v4
153+
154+ - name : Checkout VCPKG
155+ uses : actions/checkout@v4
156+ with :
157+ repository : microsoft/vcpkg
158+ ref : 2025.02.14
159+ path : vcpkg
160+
161+ - name : Install OpenMP and Ninja (MacOS)
162+ if : ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-13' }}
163+ run : |
164+ brew reinstall libomp
165+ brew link --force --overwrite libomp
166+ brew install ninja
167+
168+ - name : Bootstrap VCPKG (Windows)
169+ if : ${{ matrix.os == 'windows-latest' }}
170+ working-directory : ${{ env.VCPKG_ROOT }}
171+ run : |
172+ .\bootstrap-vcpkg${{ matrix.shell_extension }}
173+ .\vcpkg.exe integrate install
174+
175+ - name : Bootstrap VCPKG (Unix like)
176+ if : ${{ matrix.os != 'windows-latest' }}
177+ working-directory : ${{ env.VCPKG_ROOT }}
178+ run : |
179+ ./bootstrap-vcpkg${{ matrix.shell_extension }}
180+ chmod +x vcpkg
168181
182+ - name : Export GitHub Actions cache environment variables
183+ uses : actions/github-script@v7
184+ with :
185+ script : |
186+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
187+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
188+
169189 - name : Setup python
170190 uses : actions/setup-python@v4
171191 with :
@@ -175,23 +195,33 @@ jobs:
175195 working-directory : ${{ github.workspace }}/python
176196 run : |
177197 python -m pip install --upgrade pip
178- python -m pip install -r requirements-swmm .txt
198+ python -m pip install -r requirements.txt
179199
180- - name : Build Wheels
181- working-directory : ${{ github.workspace }}/python
182- run : |
183- python -m build --sduild
184- cibuildwheel --output-dir wheelhouse
185-
186200 - name : Build and Install
187201 working-directory : ${{ github.workspace }}/python
188202 run : |
203+ pyclean .
204+ python setup.py build_ext --inplace
189205 python -m pip install .
190206
191207 - name : Unit Test
192208 working-directory : ${{ github.workspace }}/python
193209 run : |
194210 python -m pytest -v tests
211+ python setup.py clean --all
212+ python -m build .
213+
214+ - name : Build Wheels
215+ uses : pypa/cibuildwheel@v2.23.2
216+ with :
217+ package-dir : ./python
218+ output-dir : ./python/wheelhouse
219+ env :
220+ # CIBW_TEST_COMMAND: "python {package}/setup.py build_ext --inplace && python -m pip install {package} && python -m pytest {package}/tests -v"
221+ CIBW_BEFORE_TEST : " pip install -r {package}/requirements.txt && python -m pip install ninja"
222+ CIBW_BUILD_VERBOSITY : 1
223+ CIBW_BEFORE_BUILD_MACOS : brew install ninja
224+ CIBW_REPAIR_WHEEL_COMMAND : ' '
195225
196226 - name : Upload Python Wheels
197227 if : ${{ always() }}
0 commit comments