2
0

continuous.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 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. # https://github.com/actions/cache/issues/101
  100. - name: Set env
  101. run: |
  102. echo "::set-env name=appdata::$($env:LOCALAPPDATA)"
  103. echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_69_0"
  104. - name: Cache build
  105. id: cache-build
  106. uses: actions/cache@v1
  107. with:
  108. path: ${{ env.appdata }}\Mozilla\sccache
  109. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  110. - name: Prepare sccache
  111. run: |
  112. Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
  113. scoop install sccache --global
  114. # Scoop modifies the PATH so we make the modified PATH global.
  115. echo "::set-env name=PATH::$env:PATH"
  116. # We run configure + build in the same step, since they both need to call VsDevCmd
  117. # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
  118. - name: Configure and build
  119. shell: cmd
  120. run: |
  121. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
  122. cmake -G Ninja ^
  123. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
  124. -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
  125. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
  126. -DLIBIGL_WITH_CGAL=ON ^
  127. -DLIBIGL_WITH_COMISO=OFF ^
  128. -B build ^
  129. -S .
  130. cmake --build build
  131. - name: Tests
  132. run: cd build; ctest --verbose