continuous.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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.name }} (${{ matrix.config }}, ${{ fromJSON('["HeaderOnly", "Static"]')[matrix.static == 'ON'] }})
  20. runs-on: ${{ matrix.os }}
  21. strategy:
  22. fail-fast: false
  23. matrix:
  24. os: [ubuntu-20.04, macos-latest]
  25. config: [Release]
  26. static: [ON, OFF]
  27. include:
  28. - os: macos-latest
  29. name: macOS
  30. - os: ubuntu-20.04
  31. name: Linux
  32. env:
  33. IGL_NUM_THREADS: 1 # See https://github.com/libigl/libigl/pull/996
  34. steps:
  35. - name: Checkout repository
  36. uses: actions/checkout@v1
  37. with:
  38. fetch-depth: 10
  39. - name: Dependencies (Linux)
  40. if: runner.os == 'Linux'
  41. run: |
  42. sudo apt-get update
  43. sudo apt-get install \
  44. libblas-dev \
  45. libboost-filesystem-dev \
  46. libboost-system-dev \
  47. libboost-thread-dev \
  48. libglu1-mesa-dev \
  49. liblapack-dev \
  50. libmpfr-dev \
  51. xorg-dev \
  52. ccache
  53. - name: Dependencies (macOS)
  54. if: runner.os == 'macOS'
  55. run: |
  56. brew update
  57. brew install boost gmp mpfr ccache
  58. - name: Cache Build
  59. id: cache-build
  60. uses: actions/cache@v1
  61. with:
  62. path: ~/.ccache
  63. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  64. - name: Prepare ccache
  65. run: |
  66. ccache --max-size=1.0G
  67. ccache -V && ccache --show-stats && ccache --zero-stats
  68. - name: Configure
  69. run: |
  70. mkdir -p build
  71. cd build
  72. cmake .. \
  73. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
  74. -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
  75. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} \
  76. -DLIBIGL_WITH_CGAL=ON \
  77. -DLIBIGL_WITH_COMISO=ON
  78. - name: Build
  79. run: cd build; make -j2; ccache --show-stats
  80. - name: Tests
  81. run: cd build; ctest --verbose
  82. ####################
  83. # Windows
  84. ####################
  85. Windows:
  86. name: Windows (${{ matrix.config }}, ${{ fromJSON('["HeaderOnly", "Static"]')[matrix.static == 'ON'] }})
  87. runs-on: windows-2019
  88. env:
  89. CC: cl.exe
  90. CXX: cl.exe
  91. strategy:
  92. fail-fast: false
  93. matrix:
  94. config: [Release]
  95. static: [ON, OFF]
  96. steps:
  97. - name: Checkout repository
  98. uses: actions/checkout@v1
  99. with:
  100. fetch-depth: 10
  101. - uses: seanmiddleditch/gha-setup-ninja@master
  102. - name: Setup Conda
  103. uses: conda-incubator/setup-miniconda@v2
  104. with:
  105. activate-environment: libigl-cgal
  106. environment-file: cmake/libigl-cgal.yml
  107. auto-activate-base: false
  108. - name: Set env
  109. run: |
  110. echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
  111. - name: Cache build
  112. id: cache-build
  113. uses: actions/cache@v1
  114. with:
  115. path: ${{ env.appdata }}\Mozilla\sccache
  116. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  117. - name: Prepare sccache
  118. run: |
  119. Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
  120. scoop install sccache --global
  121. # Scoop modifies the PATH so we make it available for the next steps of the job
  122. echo "${env:PATH}" >> ${env:GITHUB_PATH}
  123. # We run configure + build in the same step, since they both need to call VsDevCmd
  124. # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
  125. - name: Configure and build
  126. shell: cmd
  127. run: |
  128. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
  129. cmake -G Ninja ^
  130. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
  131. -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
  132. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
  133. -DLIBIGL_WITH_CGAL=ON ^
  134. -DLIBIGL_WITH_COMISO=OFF ^
  135. -DCMAKE_JOB_POOLS=pool-linking=1;pool-compilation=2 ^
  136. -DCMAKE_JOB_POOL_COMPILE:STRING=pool-compilation ^
  137. -DCMAKE_JOB_POOL_LINK:STRING=pool-linking ^
  138. -B build ^
  139. -S .
  140. cmake --build build
  141. - name: Tests
  142. run: cd build; ctest --verbose