linux.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. name: linux
  2. on: [push, pull_request]
  3. permissions:
  4. contents: read
  5. jobs:
  6. build:
  7. runs-on: ubuntu-22.04
  8. strategy:
  9. matrix:
  10. cxx: [g++-4.9, g++-11, clang++-3.6, clang++-11]
  11. build_type: [Debug, Release]
  12. std: [11]
  13. shared: [""]
  14. include:
  15. - cxx: g++-4.9
  16. - cxx: clang++-3.6
  17. - cxx: g++-11
  18. build_type: Debug
  19. std: 14
  20. install: sudo apt install g++-11
  21. - cxx: g++-11
  22. build_type: Debug
  23. std: 17
  24. - cxx: g++-11
  25. build_type: Debug
  26. std: 20
  27. install: sudo apt install g++-11
  28. - cxx: g++-13
  29. build_type: Release
  30. std: 23
  31. install: sudo apt install g++-13
  32. shared: -DBUILD_SHARED_LIBS=ON
  33. - cxx: clang++-11
  34. build_type: Debug
  35. std: 17
  36. cxxflags: -stdlib=libc++
  37. install: sudo apt install clang-11 libc++-11-dev libc++abi-11-dev
  38. - cxx: clang++-11
  39. install: sudo apt install clang-11
  40. - cxx: clang++-11
  41. build_type: Debug
  42. fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
  43. std: 17
  44. install: sudo apt install clang-11
  45. - cxx: clang++-14
  46. build_type: Debug
  47. std: 20
  48. - cxx: clang++-14
  49. build_type: Debug
  50. std: 20
  51. cxxflags: -stdlib=libc++
  52. install: sudo apt install libc++-14-dev libc++abi-14-dev
  53. steps:
  54. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
  55. - name: Set timezone
  56. run: sudo timedatectl set-timezone 'Europe/Kyiv'
  57. - name: Install GCC 4.9
  58. run: |
  59. sudo apt update
  60. sudo apt install libatomic1 libc6-dev libgomp1 libitm1 libmpc3
  61. # https://launchpad.net/ubuntu/xenial/amd64/g++-4.9/4.9.3-13ubuntu2
  62. wget --no-verbose \
  63. http://launchpadlibrarian.net/230069137/libmpfr4_3.1.3-2_amd64.deb \
  64. http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb \
  65. http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  66. http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  67. http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
  68. http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
  69. http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
  70. http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  71. http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
  72. http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
  73. http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.deb
  74. sudo dpkg -i \
  75. libmpfr4_3.1.3-2_amd64.deb \
  76. libasan1_4.9.3-13ubuntu2_amd64.deb \
  77. libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  78. libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  79. libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
  80. libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb \
  81. gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb \
  82. gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  83. cpp-4.9_4.9.3-13ubuntu2_amd64.deb \
  84. gcc-4.9_4.9.3-13ubuntu2_amd64.deb \
  85. g++-4.9_4.9.3-13ubuntu2_amd64.deb
  86. if: ${{ matrix.cxx == 'g++-4.9' }}
  87. - name: Install Clang 3.6
  88. run: |
  89. sudo apt update
  90. sudo apt install libtinfo5
  91. # https://code.launchpad.net/ubuntu/xenial/amd64/clang-3.6/1:3.6.2-3ubuntu2
  92. wget --no-verbose \
  93. http://launchpadlibrarian.net/230019046/libffi6_3.2.1-4_amd64.deb \
  94. http://launchpadlibrarian.net/445346109/libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  95. http://launchpadlibrarian.net/445346135/libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  96. http://launchpadlibrarian.net/445346112/libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  97. http://launchpadlibrarian.net/445346128/libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  98. http://launchpadlibrarian.net/445346113/libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  99. http://launchpadlibrarian.net/445346131/libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  100. http://launchpadlibrarian.net/445346022/libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  101. http://launchpadlibrarian.net/254405108/libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
  102. http://launchpadlibrarian.net/254405097/libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
  103. http://launchpadlibrarian.net/254405101/libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
  104. http://launchpadlibrarian.net/445345919/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  105. http://launchpadlibrarian.net/254405091/clang-3.6_3.6.2-3ubuntu2_amd64.deb
  106. sudo dpkg -i \
  107. libffi6_3.2.1-4_amd64.deb \
  108. libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  109. libubsan0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  110. libcilkrts5_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  111. libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  112. libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  113. libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  114. libobjc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  115. libllvm3.6v5_3.6.2-3ubuntu2_amd64.deb \
  116. libclang-common-3.6-dev_3.6.2-3ubuntu2_amd64.deb \
  117. libclang1-3.6_3.6.2-3ubuntu2_amd64.deb \
  118. gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb \
  119. clang-3.6_3.6.2-3ubuntu2_amd64.deb
  120. if: ${{ matrix.cxx == 'clang++-3.6' }}
  121. - name: Add repositories for newer GCC
  122. run: |
  123. sudo apt-add-repository ppa:ubuntu-toolchain-r/test
  124. if: ${{ matrix.cxx == 'g++-13' }}
  125. - name: Add Ubuntu mirrors
  126. run: |
  127. # GitHub Actions caching proxy is at times unreliable
  128. # see https://github.com/actions/runner-images/issues/7048.
  129. mirrors=/etc/apt/mirrors.txt
  130. printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | \
  131. sudo tee $mirrors
  132. curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append $mirrors
  133. sudo sed -i \
  134. "s~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:$mirrors~" \
  135. /etc/apt/sources.list
  136. - name: Create build environment
  137. run: |
  138. sudo apt update
  139. ${{matrix.install}}
  140. sudo apt install locales-all
  141. cmake -E make_directory ${{runner.workspace}}/build
  142. - name: Configure
  143. working-directory: ${{runner.workspace}}/build
  144. env:
  145. CXX: ${{matrix.cxx}}
  146. CXXFLAGS: ${{matrix.cxxflags}}
  147. run: |
  148. cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
  149. -DCMAKE_CXX_STANDARD=${{matrix.std}} \
  150. -DCMAKE_CXX_VISIBILITY_PRESET=hidden \
  151. -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
  152. -DFMT_DOC=OFF -DFMT_PEDANTIC=ON -DFMT_WERROR=ON \
  153. ${{matrix.fuzz}} ${{matrix.shared}} $GITHUB_WORKSPACE
  154. - name: Build
  155. working-directory: ${{runner.workspace}}/build
  156. run: |
  157. threads=`nproc`
  158. cmake --build . --config ${{matrix.build_type}} --parallel $threads
  159. - name: Test
  160. working-directory: ${{runner.workspace}}/build
  161. run: ctest -C ${{matrix.build_type}}
  162. env:
  163. CTEST_OUTPUT_ON_FAILURE: True