Open SWMM Version 6.0.0 Debut Release #65
This file contains hidden or 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
| name: Unit Testing | |
| on: | |
| push: | |
| branches: [master, main, develop] | |
| pull_request: | |
| branches: [master, main, develop] | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| OMP_NUM_THREADS: 1 | |
| jobs: | |
| # ────────────────────────────────────────────────────────────────────── | |
| # C / C++ Engine — build, unit test, and package | |
| # ────────────────────────────────────────────────────────────────────── | |
| engine: | |
| name: "C++ Engine (${{ matrix.alias }})" | |
| permissions: | |
| contents: read | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| alias: Linux-x64 | |
| cmake_preset: Linux | |
| shell_ext: .sh | |
| vcpkg_triplet: x64-linux | |
| cmake_osx_arch: "" | |
| - os: macos-latest | |
| alias: macOS-arm64 | |
| cmake_preset: Darwin | |
| shell_ext: .sh | |
| vcpkg_triplet: arm64-osx | |
| cmake_osx_arch: arm64 | |
| - os: macos-15-intel | |
| alias: macOS-x64 | |
| cmake_preset: Darwin | |
| shell_ext: .sh | |
| vcpkg_triplet: x64-osx | |
| cmake_osx_arch: x86_64 | |
| - os: windows-latest | |
| alias: Windows-x64 | |
| cmake_preset: Windows | |
| shell_ext: .bat | |
| vcpkg_triplet: x64-windows | |
| cmake_osx_arch: "" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Checkout vcpkg | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: microsoft/vcpkg | |
| ref: 2025.02.14 | |
| path: vcpkg | |
| - name: Install OpenMP (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install libomp | |
| - name: Install Ninja (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| - name: Bootstrap vcpkg (Windows) | |
| if: runner.os == 'Windows' | |
| working-directory: ${{ env.VCPKG_ROOT }} | |
| run: | | |
| .\bootstrap-vcpkg${{ matrix.shell_ext }} | |
| .\vcpkg.exe integrate install | |
| - name: Bootstrap vcpkg (Unix) | |
| if: runner.os != 'Windows' | |
| working-directory: ${{ env.VCPKG_ROOT }} | |
| run: | | |
| ./bootstrap-vcpkg${{ matrix.shell_ext }} | |
| chmod +x vcpkg | |
| - name: Export GitHub Actions cache variables | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - name: Configure | |
| run: > | |
| cmake | |
| --preset=${{ matrix.cmake_preset }}-debug | |
| -B build-${{ matrix.vcpkg_triplet }} | |
| -DOPENSWMM_BUILD_TESTS=OFF | |
| -DOPENSWMM_BUILD_UNIT_TESTS=ON | |
| -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_osx_arch }} | |
| - name: Build | |
| run: cmake --build build-${{ matrix.vcpkg_triplet }} --config Debug | |
| - name: Unit tests | |
| run: ctest --test-dir build-${{ matrix.vcpkg_triplet }} -C Debug -L unit --output-on-failure | |
| - name: Package | |
| run: cmake --build build-${{ matrix.vcpkg_triplet }} --target package | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: engine-${{ matrix.vcpkg_triplet }} | |
| path: | | |
| build-${{ matrix.vcpkg_triplet }}/*.tar.gz | |
| build-${{ matrix.vcpkg_triplet }}/*.zip | |
| # ────────────────────────────────────────────────────────────────────── | |
| # Python bindings — build, test, and wheel packaging | |
| # ────────────────────────────────────────────────────────────────────── | |
| # python: | |
| # name: "Python (${{ matrix.alias }})" | |
| # needs: engine | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # include: | |
| # - os: ubuntu-latest | |
| # alias: Linux-x64 | |
| # vcpkg_triplet: x64-linux | |
| # cmake_osx_arch: "" | |
| # - os: macos-latest | |
| # alias: macOS-arm64 | |
| # vcpkg_triplet: arm64-osx | |
| # cmake_osx_arch: arm64 | |
| # - os: macos-15-intel | |
| # alias: macOS-x64 | |
| # vcpkg_triplet: x64-osx | |
| # cmake_osx_arch: x86_64 | |
| # - os: windows-latest | |
| # alias: Windows-x64 | |
| # vcpkg_triplet: x64-windows | |
| # cmake_osx_arch: "" | |
| # runs-on: ${{ matrix.os }} | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v5 | |
| # - name: Install OpenMP and Ninja (macOS) | |
| # if: runner.os == 'macOS' | |
| # run: brew install libomp ninja | |
| # - name: Install Ninja (Linux) | |
| # if: runner.os == 'Linux' | |
| # run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| # - name: Set up Python | |
| # uses: actions/setup-python@v5 | |
| # with: | |
| # python-version: "3.13" | |
| # - name: Install Python requirements | |
| # working-directory: python | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # python -m pip install -r requirements.txt | |
| # - name: Build and install (Windows) | |
| # if: runner.os == 'Windows' | |
| # working-directory: python | |
| # env: | |
| # CMAKE_GENERATOR: "Visual Studio 17 2022" | |
| # run: python -m pip install . | |
| # - name: Build and install (Unix) | |
| # if: runner.os != 'Windows' | |
| # working-directory: python | |
| # env: | |
| # CMAKE_OSX_ARCHITECTURES: ${{ matrix.cmake_osx_arch }} | |
| # run: python -m pip install . | |
| # - name: Run Python tests | |
| # env: | |
| # CMAKE_OSX_ARCHITECTURES: ${{ matrix.cmake_osx_arch }} | |
| # working-directory: python | |
| # run: | | |
| # # Temporarily hide source tree so installed package is used | |
| # mv openswmm openswmm_src | |
| # python -m pytest -v tests | |
| # mv openswmm_src openswmm | |
| # - name: Build wheel (Windows) | |
| # if: runner.os == 'Windows' | |
| # working-directory: python | |
| # env: | |
| # CMAKE_GENERATOR: "Visual Studio 17 2022" | |
| # run: python setup.py bdist_wheel | |
| # - name: Build wheel (Unix) | |
| # if: runner.os != 'Windows' | |
| # working-directory: python | |
| # env: | |
| # CMAKE_OSX_ARCHITECTURES: ${{ matrix.cmake_osx_arch }} | |
| # run: python setup.py bdist_wheel | |
| # - name: Upload Python wheel | |
| # if: always() | |
| # uses: actions/upload-artifact@v5 | |
| # with: | |
| # name: python-wheel-${{ matrix.vcpkg_triplet }} | |
| # path: python/dist/*.whl |