Update to new remoting code (sync' with fmu-manipulation-toolbox) #258
Workflow file for this run
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: Build FMPy | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-binaries: | |
| strategy: | |
| matrix: | |
| include: | |
| - name: windows | |
| image: windows-2022 | |
| - name: linux | |
| image: ubuntu-22.04 | |
| - name: darwin | |
| image: macos-14 | |
| runs-on: ${{ matrix.image }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: "3.31.9" | |
| - run: cmake --version | |
| - run: python -m pip install fmpy requests toml | |
| - run: | | |
| cmake --version | |
| cd native | |
| python build_cvode.py | |
| - run: | | |
| cd native | |
| python build_binaries.py | |
| - if: matrix.name == 'linux' || matrix.name == 'windows' | |
| run: | | |
| cd native | |
| python build_remoting.py | |
| - if: matrix.name == 'darwin' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: | | |
| src/fmpy/cswrapper/cswrapper.dylib | |
| src/fmpy/fmucontainer/binaries/darwin64/FMUContainer.dylib | |
| src/fmpy/logging/darwin64/logging.dylib | |
| src/fmpy/sundials/aarch64-darwin/sundials_core.dylib | |
| src/fmpy/sundials/aarch64-darwin/sundials_cvode.dylib | |
| src/fmpy/sundials/aarch64-darwin/sundials_nvecserial.dylib | |
| src/fmpy/sundials/aarch64-darwin/sundials_sunlinsoldense.dylib | |
| src/fmpy/sundials/aarch64-darwin/sundials_sunmatrixdense.dylib | |
| if-no-files-found: error | |
| - if: matrix.name == 'linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: | | |
| src/fmpy/cswrapper/cswrapper.so | |
| src/fmpy/fmucontainer/binaries/linux64/FMUContainer.so | |
| src/fmpy/remoting/linux64/client_tcp.so | |
| src/fmpy/remoting/linux64/server_tcp | |
| src/fmpy/logging/linux64/logging.so | |
| src/fmpy/sundials/x86_64-linux/sundials_core.so | |
| src/fmpy/sundials/x86_64-linux/sundials_cvode.so | |
| src/fmpy/sundials/x86_64-linux/sundials_nvecserial.so | |
| src/fmpy/sundials/x86_64-linux/sundials_sunlinsoldense.so | |
| src/fmpy/sundials/x86_64-linux/sundials_sunmatrixdense.so | |
| if-no-files-found: error | |
| - if: matrix.name == 'windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: | | |
| src/fmpy/cswrapper/cswrapper.dll | |
| src/fmpy/fmucontainer/binaries/win32/FMUContainer.dll | |
| src/fmpy/fmucontainer/binaries/win64/FMUContainer.dll | |
| src/fmpy/remoting/win32/client_sm.dll | |
| src/fmpy/remoting/win32/client_tcp.dll | |
| src/fmpy/remoting/win32/server_tcp.exe | |
| src/fmpy/remoting/win32/server_sm.exe | |
| src/fmpy/remoting/win64/client_sm.dll | |
| src/fmpy/remoting/win64/client_tcp.dll | |
| src/fmpy/remoting/win64/server_tcp.exe | |
| src/fmpy/remoting/win64/server_sm.exe | |
| src/fmpy/logging/win32/logging.dll | |
| src/fmpy/logging/win64/logging.dll | |
| src/fmpy/sundials/x86_64-windows/sundials_core.dll | |
| src/fmpy/sundials/x86_64-windows/sundials_cvode.dll | |
| src/fmpy/sundials/x86_64-windows/sundials_nvecserial.dll | |
| src/fmpy/sundials/x86_64-windows/sundials_sunlinsoldense.dll | |
| src/fmpy/sundials/x86_64-windows/sundials_sunmatrixdense.dll | |
| if-no-files-found: error | |
| build-wheel: | |
| runs-on: ubuntu-22.04 | |
| needs: [ build-binaries ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - uses: astral-sh/setup-uv@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: linux | |
| path: src/fmpy | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: darwin | |
| path: src/fmpy | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: windows | |
| path: src/fmpy | |
| - run: uv sync --all-extras | |
| - run: uv run native/copy_sources.py | |
| - run: uv run native/compile_resources.py | |
| - run: uv build --wheel | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| if-no-files-found: error | |
| run-tests: | |
| strategy: | |
| matrix: | |
| include: | |
| - name: windows | |
| image: windows-2022 | |
| - name: linux | |
| image: ubuntu-22.04 | |
| - name: darwin | |
| image: macos-14 | |
| runs-on: ${{ matrix.image }} | |
| needs: [ build-wheel ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'true' | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: . | |
| - run: ls | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - if: matrix.name == 'linux' || matrix.name == 'darwin' | |
| run: | | |
| for f in fmpy-*.whl; do | |
| python -m pip install $f[complete] | |
| done | |
| - if: matrix.name == 'windows' | |
| run: | | |
| $files = Get-ChildItem "fmpy-*.whl" | |
| foreach ($f in $files) { | |
| $name = $f.FullName + "[complete]" | |
| python -m pip install $name | |
| } | |
| - run: python -m pip install pytest nbformat nbclient | |
| - run: pytest tests |