|
| 1 | + |
| 2 | +# Single package (subdirectory) builds of the components, based on CMake starter workflow template |
| 3 | +name: Single package builds, CMake multi-platform |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "devel", "master" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "devel", "master" ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + |
| 15 | + strategy: |
| 16 | + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. |
| 17 | + fail-fast: true |
| 18 | + |
| 19 | + # Set up a matrix to run the following 3 configurations: |
| 20 | + # 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator> |
| 21 | + # 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator> |
| 22 | + # 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator> |
| 23 | + # |
| 24 | + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. |
| 25 | + matrix: |
| 26 | + os: [ubuntu-latest] |
| 27 | + build_type: [Release, Debug] |
| 28 | + c_compiler: [gcc, clang] |
| 29 | + include: |
| 30 | + - os: ubuntu-latest |
| 31 | + c_compiler: gcc |
| 32 | + cpp_compiler: g++ |
| 33 | + - os: ubuntu-latest |
| 34 | + c_compiler: clang |
| 35 | + cpp_compiler: clang++ |
| 36 | + |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Install Qt dependencies |
| 42 | + run: sudo apt-get -y install libqglviewer-dev-qt5 libqt5opengl5-dev |
| 43 | + |
| 44 | + - name: Set reusable strings |
| 45 | + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. |
| 46 | + id: strings |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + echo "octomap-build-output-dir=${{ github.workspace }}/octomap/build" >> "$GITHUB_OUTPUT" |
| 50 | + echo "dynamicEDT3D-build-output-dir=${{ github.workspace }}/dynamicEDT3D/build" >> "$GITHUB_OUTPUT" |
| 51 | + echo "octovis-build-output-dir=${{ github.workspace }}/octovis/build" >> "$GITHUB_OUTPUT" |
| 52 | +
|
| 53 | + - name: octomap - Configure CMake |
| 54 | + working-directory: octomap |
| 55 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 56 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 57 | + run: > |
| 58 | + cmake -B ${{ steps.strings.outputs.octomap-build-output-dir }} |
| 59 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 60 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 61 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 62 | + -S ${{ github.workspace }}/octomap |
| 63 | +
|
| 64 | + - name: octomap - Build |
| 65 | + working-directory: octomap |
| 66 | + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 67 | + run: cmake --build ${{ steps.strings.outputs.octomap-build-output-dir }} --config ${{ matrix.build_type }} |
| 68 | + |
| 69 | + - name: octomap - Test |
| 70 | + working-directory: ${{ steps.strings.outputs.octomap-build-output-dir }} |
| 71 | + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 72 | + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
| 73 | + run: ctest --build-config ${{ matrix.build_type }} |
| 74 | + |
| 75 | + - name: dynamicEDT3D - Configure CMake |
| 76 | + working-directory: dynamicEDT3D |
| 77 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 78 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 79 | + run: > |
| 80 | + cmake -B ${{ steps.strings.outputs.dynamicEDT3D-build-output-dir }} |
| 81 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 82 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 83 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 84 | + -S ${{ github.workspace }}/dynamicEDT3D |
| 85 | +
|
| 86 | + - name: dynamicEDT3D - Build |
| 87 | + working-directory: dynamicEDT3D |
| 88 | + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 89 | + run: cmake --build ${{ steps.strings.outputs.dynamicEDT3D-build-output-dir }} --config ${{ matrix.build_type }} |
| 90 | + |
| 91 | + # No tests available |
| 92 | + |
| 93 | + - name: octovis - Configure CMake |
| 94 | + working-directory: octovis |
| 95 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 96 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 97 | + run: > |
| 98 | + cmake -B ${{ steps.strings.outputs.octovis-build-output-dir }} |
| 99 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 100 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 101 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 102 | + -S ${{ github.workspace }}/octovis |
| 103 | +
|
| 104 | + - name: octovis - Build |
| 105 | + working-directory: octovis |
| 106 | + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 107 | + run: cmake --build ${{ steps.strings.outputs.octovis-build-output-dir }} --config ${{ matrix.build_type }} |
| 108 | + |
| 109 | + # No tests available |
| 110 | + |
0 commit comments