continuous.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. libglu1-mesa-dev \
  46. liblapack-dev \
  47. libmpfr-dev \
  48. xorg-dev \
  49. ccache
  50. - name: Dependencies (macOS)
  51. if: runner.os == 'macOS'
  52. run: |
  53. brew update
  54. brew install gmp mpfr ccache
  55. - name: Cache Build
  56. id: cache-build
  57. uses: actions/cache@v2
  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_COPYLEFT_CGAL=ON
  74. - name: Build
  75. run: cd build; make -j2; ccache --show-stats
  76. - name: Tests
  77. run: cd build; ctest --verbose
  78. ####################
  79. # Windows
  80. ####################
  81. Windows:
  82. name: Windows (${{ matrix.config }}, ${{ fromJSON('["HeaderOnly", "Static"]')[matrix.static == 'ON'] }})
  83. runs-on: windows-2022
  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. - name: Set env
  99. run: |
  100. echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
  101. - name: Cache build
  102. id: cache-build
  103. uses: actions/cache@v2
  104. with:
  105. path: ${{ env.appdata }}\Mozilla\sccache
  106. key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
  107. - name: Prepare sccache
  108. run: |
  109. Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
  110. scoop install sccache --global
  111. # Scoop modifies the PATH so we make it available for the next steps of the job
  112. echo "${env:PATH}" >> ${env:GITHUB_PATH}
  113. # We run configure + build in the same step, since they both need to call VsDevCmd
  114. # Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
  115. - name: Configure and build
  116. shell: cmd
  117. run: |
  118. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
  119. cmake -G Ninja ^
  120. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
  121. -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
  122. -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
  123. -DLIBIGL_COPYLEFT_CGAL=ON ^
  124. -DCMAKE_JOB_POOLS=pool-linking=1;pool-compilation=1 ^
  125. -DCMAKE_JOB_POOL_COMPILE:STRING=pool-compilation ^
  126. -DCMAKE_JOB_POOL_LINK:STRING=pool-linking ^
  127. -B build ^
  128. -S .
  129. cmake --build build
  130. - name: Tests
  131. run: cd build; ctest --verbose