continuous.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - stable
  7. pull_request:
  8. branches:
  9. - master
  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 }}, ${{ matrix.static }})
  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. LIBIGL_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: brew install boost gmp mpfr ccache
  56. - name: Cache Build
  57. id: cache-build
  58. uses: actions/cache@v1
  59. with:
  60. path: ~/.ccache
  61. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  62. - name: Prepare ccache
  63. run: |
  64. ccache --max-size=1.0G
  65. ccache -V && ccache --show-stats && ccache --zero-stats
  66. - name: Configure
  67. run: |
  68. mkdir -p build
  69. cd build
  70. cmake .. \
  71. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
  72. -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
  73. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} \
  74. -DLIBIGL_WITH_CGAL=ON \
  75. -DLIBIGL_WITH_COMISO=ON
  76. - name: Build
  77. run: cd build; make -j2; ccache --show-stats
  78. - name: Tests
  79. run: cd build; ctest --verbose
  80. ####################
  81. # Windows
  82. ####################
  83. Windows:
  84. runs-on: windows-2019
  85. env:
  86. CC: cl.exe
  87. CXX: cl.exe
  88. strategy:
  89. fail-fast: false
  90. matrix:
  91. config: [Release]
  92. static: [ON, OFF]
  93. steps:
  94. - name: Checkout repository
  95. uses: actions/checkout@v1
  96. with:
  97. fetch-depth: 10
  98. - uses: seanmiddleditch/gha-setup-ninja@master
  99. - name: Set env
  100. run: |
  101. echo "BOOST_ROOT=$env:BOOST_ROOT_1_72_0" >> ${env:GITHUB_ENV}
  102. echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
  103. - name: Cache build
  104. id: cache-build
  105. uses: actions/cache@v1
  106. with:
  107. path: ${{ env.appdata }}\Mozilla\sccache
  108. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  109. - name: Prepare sccache
  110. run: |
  111. Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
  112. scoop install sccache --global
  113. # Scoop modifies the PATH so we make it available for the next steps of the job
  114. echo "${env:PATH}" >> ${env:GITHUB_PATH}
  115. # We run configure + build in the same step, since they both need to call VsDevCmd
  116. # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
  117. - name: Configure and build
  118. shell: cmd
  119. run: |
  120. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
  121. cmake -G Ninja ^
  122. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
  123. -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
  124. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
  125. -DLIBIGL_WITH_CGAL=ON ^
  126. -DLIBIGL_WITH_COMISO=OFF ^
  127. -DCMAKE_JOB_POOLS=pool-linking=1;pool-compilation=2 ^
  128. -DCMAKE_JOB_POOL_COMPILE:STRING=pool-compilation ^
  129. -DCMAKE_JOB_POOL_LINK:STRING=pool-linking ^
  130. -B build ^
  131. -S .
  132. cmake --build build
  133. - name: Tests
  134. run: cd build; ctest --verbose