|
| 1 | +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. |
| 2 | +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml |
| 3 | +name: CMake on ubuntu-22.04 |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "main" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "main" ] |
| 10 | + |
| 11 | +env: |
| 12 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 13 | + BUILD_TYPE: RelWithDebInfo |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 18 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 19 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v5 |
| 24 | + |
| 25 | + - name: InstallHOPS4Deps |
| 26 | + #install HOPS4 and HOPS3 dependencies |
| 27 | + run: sudo apt-get install build-essential cmake cmake-curses-gui python3-dev python3-pip wget jq |
| 28 | + |
| 29 | + - name: InstallHOPS3Deps |
| 30 | + run: sudo apt-get install libfftw3-dev pgplot5 libgfortran5 libx11-dev gnuplot binutils libxpm-dev ghostscript ghostscript-x |
| 31 | + |
| 32 | + - name: Configure CMake |
| 33 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 34 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 35 | + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DHOPS_PYPI_MANAGE_DEPS=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install |
| 36 | + |
| 37 | + - name: Build |
| 38 | + # Build your program with the given configuration |
| 39 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 6 |
| 40 | + |
| 41 | + - name: Install |
| 42 | + run: cmake --install ${{github.workspace}}/build |
| 43 | + |
| 44 | + - name: TestDataDownload |
| 45 | + run: bash ${{github.workspace}}/install/bin/testdata_download_all.sh |
| 46 | + |
| 47 | + - name: Test |
| 48 | + working-directory: ${{github.workspace}}/build |
| 49 | + # Execute tests defined by the CMake configuration. |
| 50 | + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
| 51 | + run: ctest -C ${{env.BUILD_TYPE}} |
| 52 | + |
0 commit comments