continuous.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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-18.04, macos-latest]
  25. config: [Release]
  26. static: [ON, OFF]
  27. include:
  28. - os: macos-latest
  29. name: macOS
  30. - os: ubuntu-18.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 install \
  43. libblas-dev \
  44. libboost-filesystem-dev \
  45. libboost-system-dev \
  46. libboost-thread-dev \
  47. libglu1-mesa-dev \
  48. liblapack-dev \
  49. libmpfr-dev \
  50. xorg-dev \
  51. ccache
  52. - name: Dependencies (macOS)
  53. if: runner.os == 'macOS'
  54. run: brew install boost gmp mpfr ccache
  55. - name: Cache Build
  56. id: cache-build
  57. uses: actions/cache@v1
  58. with:
  59. path: ~/.ccache
  60. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  61. - name: Prepare ccache
  62. run: |
  63. ccache --max-size=1.0G
  64. ccache -V && ccache --show-stats && ccache --zero-stats
  65. - name: Configure
  66. run: |
  67. mkdir -p build
  68. cd build
  69. cmake .. \
  70. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
  71. -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
  72. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} \
  73. -DLIBIGL_WITH_CGAL=ON \
  74. -DLIBIGL_WITH_COMISO=ON
  75. - name: Build
  76. run: cd build; make -j2; ccache --show-stats
  77. - name: Tests
  78. run: cd build; ctest --verbose
  79. ####################
  80. # Windows
  81. ####################
  82. Windows:
  83. runs-on: windows-2019
  84. env:
  85. CC: cl.exe
  86. CXX: cl.exe
  87. strategy:
  88. fail-fast: false
  89. matrix:
  90. config: [Release]
  91. static: [ON, OFF]
  92. steps:
  93. - name: Checkout repository
  94. uses: actions/checkout@v1
  95. with:
  96. fetch-depth: 10
  97. - uses: seanmiddleditch/gha-setup-ninja@master
  98. # https://github.com/actions/cache/issues/101
  99. - name: Set env
  100. run: |
  101. echo "::set-env name=appdata::$($env:LOCALAPPDATA)"
  102. echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_69_0"
  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 the modified PATH global.
  114. echo "::set-env name=PATH::$env: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. -B build ^
  128. -S .
  129. cmake --build build
  130. - name: Tests
  131. run: cd build; ctest --verbose