2
0

ubuntu.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. name: Ubuntu
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. - master
  7. - release/*
  8. pull_request:
  9. workflow_dispatch:
  10. concurrency:
  11. group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
  12. cancel-in-progress: true
  13. jobs:
  14. ci_test_clang:
  15. runs-on: ubuntu-latest
  16. container: silkeh/clang:dev
  17. steps:
  18. - name: Install git and unzip
  19. run: apt-get update ; apt-get install -y git unzip
  20. - uses: actions/checkout@v3
  21. - name: Get latest CMake and ninja
  22. uses: lukka/get-cmake@latest
  23. - name: Run CMake
  24. run: cmake -S . -B build -DJSON_CI=On
  25. - name: Build
  26. run: cmake --build build --target ci_test_clang
  27. ci_test_gcc:
  28. runs-on: ubuntu-latest
  29. container: ghcr.io/nlohmann/json-ci:v2.4.0
  30. steps:
  31. - uses: actions/checkout@v3
  32. - name: Run CMake
  33. run: cmake -S . -B build -DJSON_CI=On
  34. - name: Build
  35. run: cmake --build build --target ci_test_gcc
  36. ci_static_analysis:
  37. runs-on: ubuntu-latest
  38. container: ghcr.io/nlohmann/json-ci:v2.4.0
  39. strategy:
  40. matrix:
  41. target: [ci_cppcheck, ci_test_valgrind, ci_test_amalgamation, ci_test_single_header, ci_single_binaries, ci_infer]
  42. steps:
  43. - uses: actions/checkout@v3
  44. - name: Run CMake
  45. run: cmake -S . -B build -DJSON_CI=On
  46. - name: Build
  47. run: cmake --build build --target ${{ matrix.target }}
  48. ci_static_analysis_ubuntu:
  49. runs-on: ubuntu-latest
  50. strategy:
  51. matrix:
  52. target: [ci_cpplint, ci_reproducible_tests, ci_non_git_tests, ci_offline_testdata]
  53. steps:
  54. - uses: actions/checkout@v3
  55. - name: Get latest CMake and ninja
  56. uses: lukka/get-cmake@latest
  57. - name: Run CMake
  58. run: cmake -S . -B build -DJSON_CI=On
  59. - name: Build
  60. run: cmake --build build --target ${{ matrix.target }}
  61. ci_static_analysis_clang:
  62. runs-on: ubuntu-latest
  63. container: silkeh/clang:dev
  64. strategy:
  65. matrix:
  66. target: [ci_clang_tidy, ci_test_clang_sanitizer, ci_clang_analyze]
  67. steps:
  68. - name: Install git, clang-tools, and unzip
  69. run: apt-get update ; apt-get install -y git clang-tools unzip
  70. - uses: actions/checkout@v3
  71. - name: Get latest CMake and ninja
  72. uses: lukka/get-cmake@latest
  73. - name: Run CMake
  74. run: cmake -S . -B build -DJSON_CI=On
  75. - name: Build
  76. run: cmake --build build --target ${{ matrix.target }}
  77. ci_cmake_options:
  78. runs-on: ubuntu-latest
  79. container: ubuntu:focal
  80. strategy:
  81. matrix:
  82. target: [ci_cmake_flags, ci_test_diagnostics, ci_test_noexceptions, ci_test_noimplicitconversions, ci_test_legacycomparison, ci_test_noglobaludls]
  83. steps:
  84. - name: Install build-essential
  85. run: apt-get update ; apt-get install -y build-essential unzip clang wget lib32z1
  86. - uses: actions/checkout@v3
  87. - name: Get latest CMake and ninja
  88. uses: lukka/get-cmake@latest
  89. - name: Run CMake
  90. run: cmake -S . -B build -DJSON_CI=On
  91. - name: Build
  92. run: cmake --build build --target ${{ matrix.target }}
  93. ci_test_coverage:
  94. runs-on: ubuntu-latest
  95. container: ghcr.io/nlohmann/json-ci:v2.4.0
  96. steps:
  97. - uses: actions/checkout@v3
  98. - name: Run CMake
  99. run: cmake -S . -B build -DJSON_CI=On
  100. - name: Build
  101. run: cmake --build build --target ci_test_coverage
  102. - name: Archive coverage report
  103. uses: actions/upload-artifact@v3
  104. with:
  105. name: code-coverage-report
  106. path: ${{ github.workspace }}/build/html
  107. - name: Publish report to Coveralls
  108. uses: coverallsapp/github-action@master
  109. with:
  110. github-token: ${{ secrets.GITHUB_TOKEN }}
  111. path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept
  112. ci_test_compilers_gcc:
  113. runs-on: ubuntu-latest
  114. strategy:
  115. matrix:
  116. compiler: ['4', '5', '6', '7', '8', '9', '10', '11', '12', 'latest']
  117. container: gcc:${{ matrix.compiler }}
  118. steps:
  119. - uses: actions/checkout@v3
  120. - name: Get latest CMake and ninja
  121. uses: lukka/get-cmake@latest
  122. - name: Run CMake
  123. run: cmake -S . -B build -DJSON_CI=On
  124. - name: Build
  125. run: cmake --build build --target ci_test_compiler_default
  126. ci_test_compilers_clang:
  127. runs-on: ubuntu-latest
  128. strategy:
  129. matrix:
  130. compiler: ['3.5', '3.6', '3.7', '3.8', '3.9', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', 'latest']
  131. container: silkeh/clang:${{ matrix.compiler }}
  132. steps:
  133. - name: Install unzip
  134. run: apt-get update ; apt-get install -y unzip
  135. - uses: actions/checkout@v3
  136. - name: Get latest CMake and ninja
  137. uses: lukka/get-cmake@latest
  138. - name: Run CMake
  139. run: cmake -S . -B build -DJSON_CI=On
  140. - name: Build
  141. run: cmake --build build --target ci_test_compiler_default
  142. ci_test_compilers:
  143. runs-on: ubuntu-latest
  144. container: ghcr.io/nlohmann/json-ci:v2.4.0
  145. strategy:
  146. matrix:
  147. compiler: [g++-4.8]
  148. steps:
  149. - uses: actions/checkout@v3
  150. - name: Run CMake
  151. run: cmake -S . -B build -DJSON_CI=On
  152. - name: Build
  153. run: cmake --build build --target ci_test_compiler_${{ matrix.compiler }}
  154. ci_test_standards:
  155. runs-on: ubuntu-latest
  156. container: ghcr.io/nlohmann/json-ci:v2.4.0
  157. strategy:
  158. matrix:
  159. standard: [11, 14, 17, 20]
  160. compiler: [gcc, clang]
  161. steps:
  162. - uses: actions/checkout@v3
  163. - name: Run CMake
  164. run: cmake -S . -B build -DJSON_CI=On
  165. - name: Build
  166. run: cmake --build build --target ci_test_${{ matrix.compiler }}_cxx${{ matrix.standard }}
  167. ci_cuda_example:
  168. runs-on: ubuntu-latest
  169. container: ghcr.io/nlohmann/json-ci:v2.4.0
  170. steps:
  171. - uses: actions/checkout@v3
  172. - name: Run CMake
  173. run: cmake -S . -B build -DJSON_CI=On
  174. - name: Build
  175. run: cmake --build build --target ci_cuda_example
  176. ci_icpc:
  177. runs-on: ubuntu-latest
  178. container: ghcr.io/nlohmann/json-ci:v2.2.0
  179. steps:
  180. - uses: actions/checkout@v2
  181. - name: Run CMake
  182. run: cmake -S . -B build -DJSON_CI=On
  183. - name: Build
  184. run: |
  185. . /opt/intel/oneapi/setvars.sh
  186. cmake --build build --target ci_icpc
  187. ci_reuse_compliance:
  188. runs-on: ubuntu-latest
  189. steps:
  190. - uses: actions/checkout@v3
  191. - uses: actions/setup-python@v3
  192. - name: Install REUSE tool
  193. run: python -m pip install reuse
  194. - name: Run REUSE lint
  195. run: reuse lint
  196. ci_test_documentation:
  197. runs-on: ubuntu-latest
  198. strategy:
  199. matrix:
  200. target: [ci_test_examples, ci_test_api_documentation]
  201. steps:
  202. - uses: actions/checkout@v3
  203. - name: Run CMake
  204. run: cmake -S . -B build -DJSON_CI=On
  205. - name: Build
  206. run: cmake --build build --target ${{ matrix.target }}