|
| 1 | +# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations. |
| 2 | +# It is triggered on pushes to the master branch. |
| 3 | +# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations. |
| 4 | + |
| 5 | +name: Ubuntu build validation |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - '**' |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - 'master' |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + main_job: |
| 21 | + name: Latest ubuntu validation |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + config: |
| 27 | + - { |
| 28 | + name: "GCC", |
| 29 | + cc: "gcc", |
| 30 | + cxx: "g++" |
| 31 | + } |
| 32 | + - { |
| 33 | + name: "Clang", |
| 34 | + cc: "clang", |
| 35 | + cxx: "clang++" |
| 36 | + } |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout repository |
| 40 | + |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev |
| 44 | + |
| 45 | + - name: Install rapidjson |
| 46 | + run: | |
| 47 | + wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip |
| 48 | + unzip rapidjson.zip |
| 49 | +
|
| 50 | + - name: Configure basic |
| 51 | + run: | |
| 52 | + mkdir -p build |
| 53 | + cd build |
| 54 | + cmake -G "Ninja" \ |
| 55 | + -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \ |
| 56 | + -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ |
| 57 | + -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \ |
| 58 | + -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" .. |
| 59 | +
|
| 60 | + - name: Build basic |
| 61 | + run: | |
| 62 | + cd build |
| 63 | + cmake --build . -- -j 4 |
| 64 | +
|
| 65 | + - name: Clear up after build |
| 66 | + run: | |
| 67 | + rm -rf build |
| 68 | +
|
| 69 | + - name: Configure full shared |
| 70 | + run: | |
| 71 | + mkdir -p build |
| 72 | + cd build |
| 73 | + cmake -G "Ninja" \ |
| 74 | + -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \ |
| 75 | + -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ |
| 76 | + -D BUILD_USE_PCH=OFF \ |
| 77 | + -D BUILD_INCLUDE_SYMLINK=ON \ |
| 78 | + -D BUILD_OPT_PROFILE=Production \ |
| 79 | + -D BUILD_LIBRARY_TYPE=Shared \ |
| 80 | + -D USE_TK=ON \ |
| 81 | + -D CMAKE_BUILD_TYPE=Debug \ |
| 82 | + -D USE_MMGR_TYPE=JEMALLOC \ |
| 83 | + -D INSTALL_DIR=${{ github.workspace }}/install \ |
| 84 | + -D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \ |
| 85 | + -D USE_FREETYPE=ON \ |
| 86 | + -D USE_DRACO=ON \ |
| 87 | + -D USE_FFMPEG=OFF \ |
| 88 | + -D USE_FREEIMAGE=ON \ |
| 89 | + -D USE_GLES2=ON \ |
| 90 | + -D USE_OPENVR=ON \ |
| 91 | + -D USE_VTK=ON \ |
| 92 | + -D USE_TBB=ON \ |
| 93 | + -D USE_RAPIDJSON=ON \ |
| 94 | + -D USE_OPENGL=ON \ |
| 95 | + -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \ |
| 96 | + -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" .. |
| 97 | +
|
| 98 | + - name: Build full shared |
| 99 | + run: | |
| 100 | + cd build |
| 101 | + cmake --build . --target install --config Debug -- -j 4 |
| 102 | + |
| 103 | + - name: Clear up after build |
| 104 | + run: | |
| 105 | + rm -rf build |
| 106 | + rm -rf ${{ github.workspace }}/install |
| 107 | +
|
| 108 | + - name: Configure full static |
| 109 | + run: | |
| 110 | + mkdir -p build |
| 111 | + cd build |
| 112 | + cmake -G "Ninja" \ |
| 113 | + -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \ |
| 114 | + -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ |
| 115 | + -D BUILD_USE_PCH=OFF \ |
| 116 | + -D BUILD_INCLUDE_SYMLINK=ON \ |
| 117 | + -D BUILD_OPT_PROFILE=Production \ |
| 118 | + -D BUILD_LIBRARY_TYPE=Static \ |
| 119 | + -D USE_TK=ON \ |
| 120 | + -D CMAKE_BUILD_TYPE=Debug \ |
| 121 | + -D USE_MMGR_TYPE=JEMALLOC \ |
| 122 | + -D INSTALL_DIR=${{ github.workspace }}/install \ |
| 123 | + -D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \ |
| 124 | + -D USE_FREETYPE=ON \ |
| 125 | + -D USE_DRACO=ON \ |
| 126 | + -D USE_FFMPEG=OFF \ |
| 127 | + -D USE_FREEIMAGE=ON \ |
| 128 | + -D USE_GLES2=ON \ |
| 129 | + -D USE_OPENVR=ON \ |
| 130 | + -D USE_VTK=OFF \ |
| 131 | + -D USE_TBB=ON \ |
| 132 | + -D USE_RAPIDJSON=ON \ |
| 133 | + -D USE_OPENGL=ON \ |
| 134 | + -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \ |
| 135 | + -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" .. |
| 136 | +
|
| 137 | + - name: Build full static |
| 138 | + run: | |
| 139 | + cd build |
| 140 | + cmake --build . --target install --config Debug -- -j 4 |
| 141 | +
|
| 142 | + - name: Clear up after build |
| 143 | + run: | |
| 144 | + rm -rf build |
| 145 | + rm -rf ${{ github.workspace }}/install |
| 146 | +
|
| 147 | + - name: Configure full with DEBUG define |
| 148 | + run: | |
| 149 | + mkdir -p build |
| 150 | + cd build |
| 151 | + cmake -G "Ninja" \ |
| 152 | + -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \ |
| 153 | + -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ |
| 154 | + -D BUILD_WITH_DEBUG=ON \ |
| 155 | + -D BUILD_USE_PCH=OFF \ |
| 156 | + -D BUILD_INCLUDE_SYMLINK=ON \ |
| 157 | + -D BUILD_OPT_PROFILE=Production \ |
| 158 | + -D BUILD_LIBRARY_TYPE=Shared \ |
| 159 | + -D USE_TK=ON \ |
| 160 | + -D CMAKE_BUILD_TYPE=Debug \ |
| 161 | + -D INSTALL_DIR=${{ github.workspace }}/install \ |
| 162 | + -D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \ |
| 163 | + -D USE_FREETYPE=ON \ |
| 164 | + -D USE_DRACO=ON \ |
| 165 | + -D USE_FFMPEG=OFF \ |
| 166 | + -D USE_FREEIMAGE=ON \ |
| 167 | + -D USE_GLES2=ON \ |
| 168 | + -D USE_OPENVR=ON \ |
| 169 | + -D USE_VTK=ON \ |
| 170 | + -D USE_TBB=ON \ |
| 171 | + -D USE_RAPIDJSON=ON \ |
| 172 | + -D USE_OPENGL=ON .. |
| 173 | +
|
| 174 | + - name: Build full with DEBUG define |
| 175 | + run: | |
| 176 | + cd build |
| 177 | + cmake --build . --target install --config Debug -- -j 4 |
| 178 | + |
| 179 | + - name: Clear up after build |
| 180 | + run: | |
| 181 | + rm -rf build |
| 182 | + rm -rf ${{ github.workspace }}/install |
0 commit comments