cmake.yml - 6 #10
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: CMake Build | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
| workflow_dispatch: | ||
| jobs: | ||
| build-ubuntu: | ||
| name: Build Ubuntu | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: 2.1. Obtaining OpenSees Source Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Python 3.11 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Conan 2.x | ||
| run: | | ||
| pip install conan | ||
| conan profile detect --force | ||
| - name: 2.4.2. Building the OpenSees Applications and Python module | ||
| run: | | ||
| mkdir -p build | ||
| cd build | ||
| conan install .. --output-folder=. --build=missing | ||
| ls | ||
| ls | ||
| cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake | ||
| cmake --build . --target OpenSees -j8 | ||
| cmake --build . --target OpenSeesPy -j8 | ||
| mv lib/OpenSeesPy.so lib/opensees.so | ||
| - name: Verification OpenSeesPySP # Simple Sanity Test | ||
| run: | | ||
| export PYTHONPATH="./build/lib/" | ||
| python3 -c "import sys; print(sys.path)" | ||
| python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py | ||
| - name: Run pytest in tests/ folder | ||
| run: | | ||
| python3 -m pip install pytest | ||
| cp build/lib/opensees.so tests/ | ||
| cd tests | ||
| pytest -v | ||
| - name: Upload Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: OpenSees_Ubuntu | ||
| path: | | ||
| ./build/bin/OpenSees | ||
| ./build/lib/opensees.so | ||