continuous.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - stable
  7. pull_request:
  8. branches:
  9. - main
  10. - stable
  11. env:
  12. CTEST_OUTPUT_ON_FAILURE: ON
  13. CTEST_PARALLEL_LEVEL: 2
  14. jobs:
  15. ####################
  16. # Linux / macOS
  17. ####################
  18. Unix:
  19. name: ${{ matrix.os }} ${{ fromJSON('["Header-Only", "Static"]')[matrix.build-params.static == 'ON'] }} ${{ matrix.build-params.tutorials == 'ON' && 'tutorial' || ''}} ${{ matrix.build-params.tests == 'ON' && 'tests' || ''}} ${{ matrix.config }}
  20. runs-on: ${{ matrix.os }}
  21. strategy:
  22. fail-fast: false
  23. matrix:
  24. os: [ubuntu-24.04, macos-latest]
  25. config: [Release]
  26. build-params: [ {static: ON, tutorials: ON, tests: ON }, {static: OFF, tutorials: OFF, tests: ON }, {static: OFF, tutorials: ON, tests: OFF }]
  27. env:
  28. IGL_NUM_THREADS: 4 # don't go wild, but let the parallel_for tests do something
  29. steps:
  30. - name: Checkout repository
  31. uses: actions/checkout@v1
  32. with:
  33. fetch-depth: 10
  34. - name: Dependencies (Linux)
  35. if: runner.os == 'Linux'
  36. run: |
  37. sudo apt-get update
  38. sudo apt-get install \
  39. libblas-dev \
  40. libglu1-mesa-dev \
  41. liblapack-dev \
  42. xorg-dev \
  43. ccache
  44. - name: Dependencies (macOS)
  45. if: runner.os == 'macOS'
  46. run: |
  47. HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
  48. - name: Setup Xcode version
  49. if: runner.os == 'macOS'
  50. uses: maxim-lobanov/setup-xcode@v1
  51. with:
  52. xcode-version: '16.3.0'
  53. - name: Cache Build
  54. id: cache-build
  55. uses: actions/cache@v4
  56. with:
  57. path: ~/.ccache
  58. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.build-params.static }}-cache
  59. - name: Prepare ccache
  60. run: |
  61. ccache --max-size=1.0G
  62. ccache -V && ccache --show-stats && ccache --zero-stats
  63. - name: Configure
  64. run: |
  65. mkdir -p build
  66. cd build
  67. # https://github.com/eclipse-ecal/ecal/issues/2041
  68. cmake .. \
  69. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
  70. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
  71. -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
  72. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.build-params.static }} \
  73. -DLIBIGL_BUILD_TUTORIALS=${{ matrix.build-params.tutorials }} \
  74. -DLIBIGL_GLFW_TESTS=OFF \
  75. -DLIBIGL_BUILD_TESTS=${{ matrix.build-params.tests }} \
  76. -DLIBIGL_COPYLEFT_CGAL=ON
  77. - name: Build
  78. run: cd build; make -j2; ccache --show-stats
  79. - name: Tests
  80. run: cd build; ctest --show-only; ctest --verbose
  81. ####################
  82. # Windows
  83. ####################
  84. Windows:
  85. name: Windows ${{ fromJSON('["Header-Only", "Static"]')[matrix.build-params.static == 'ON'] }} ${{ matrix.build-params.tutorials == 'ON' && 'tutorial' || ''}} ${{ matrix.build-params.selected_tutorial != 'NONE' && matrix.build-params.selected_tutorial || '' }} ${{ matrix.build-params.tests == 'ON' && 'tests' || ''}} ${{ matrix.config }}
  86. runs-on: windows-2022
  87. strategy:
  88. fail-fast: false
  89. matrix:
  90. config: [Release]
  91. build-params: [
  92. {static: ON, tutorials: ON, tests: ON, selected_tutorial: NONE},
  93. {static: OFF, tutorials: OFF, tests: ON, selected_tutorial: NONE},
  94. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 1},
  95. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 2},
  96. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 3},
  97. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 4},
  98. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 5},
  99. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 6},
  100. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 7},
  101. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 8},
  102. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 9},
  103. {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 10},
  104. ]
  105. steps:
  106. - name: Checkout repository
  107. uses: actions/checkout@v1
  108. with:
  109. fetch-depth: 10
  110. - name: Install Ninja
  111. uses: seanmiddleditch/gha-setup-ninja@master
  112. - name: Set env variable for sccache
  113. run: |
  114. echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
  115. - name: Cache build
  116. id: cache-build
  117. uses: actions/cache@v4
  118. with:
  119. path: ${{ env.appdata }}\Mozilla\sccache
  120. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.build-params.static }}-cache
  121. - name: Prepare sccache
  122. run: |
  123. iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1'
  124. .\install.ps1 -RunAsAdmin
  125. scoop install sccache --global
  126. # Scoop modifies the PATH so we make it available for the next steps of the job
  127. echo "${env:PATH}" >> ${env:GITHUB_PATH}
  128. - name: Configure and build
  129. shell: cmd
  130. run: |
  131. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
  132. # https://github.com/eclipse-ecal/ecal/issues/2041
  133. cmake -G Ninja ^
  134. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^
  135. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
  136. -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
  137. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.build-params.static }} ^
  138. -DLIBIGL_COPYLEFT_CGAL=ON ^
  139. -DLIBIGL_BUILD_TUTORIALS=${{ matrix.build-params.tutorials }} ^
  140. -DLIBIGL_BUILD_TESTS=${{ matrix.build-params.tests }} ^
  141. -DLIBIGL_GLFW_TESTS=OFF ^
  142. -DLIBIGL_TUTORIALS_CHAPTER1=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '1') && 'ON' || 'OFF' }} ^
  143. -DLIBIGL_TUTORIALS_CHAPTER2=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '2') && 'ON' || 'OFF' }} ^
  144. -DLIBIGL_TUTORIALS_CHAPTER3=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '3') && 'ON' || 'OFF' }} ^
  145. -DLIBIGL_TUTORIALS_CHAPTER4=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '4') && 'ON' || 'OFF' }} ^
  146. -DLIBIGL_TUTORIALS_CHAPTER5=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '5') && 'ON' || 'OFF' }} ^
  147. -DLIBIGL_TUTORIALS_CHAPTER6=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '6') && 'ON' || 'OFF' }} ^
  148. -DLIBIGL_TUTORIALS_CHAPTER7=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '7') && 'ON' || 'OFF' }} ^
  149. -DLIBIGL_TUTORIALS_CHAPTER8=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '8') && 'ON' || 'OFF' }} ^
  150. -DLIBIGL_TUTORIALS_CHAPTER9=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '9') && 'ON' || 'OFF' }} ^
  151. -DLIBIGL_TUTORIALS_CHAPTER10=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '10') && 'ON' || 'OFF' }} ^
  152. -B build ^
  153. -S .
  154. cmake --build build -j2
  155. - name: Tests
  156. run: cd build; ctest --show-only; ctest --verbose -j2