linux.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. name: linux
  2. # build on c/cpp changes or workflow changes
  3. on:
  4. push:
  5. paths:
  6. - 'lib/**.[ch]'
  7. - 'lib/**.cpp'
  8. - 'src/**.[ch]'
  9. - 'src/**.cpp'
  10. - 'irr/**.[ch]'
  11. - 'irr/**.cpp'
  12. - '**/CMakeLists.txt'
  13. - 'cmake/Modules/**'
  14. - 'po/**.po'
  15. - 'util/ci/**'
  16. - '.github/workflows/linux.yml'
  17. pull_request:
  18. paths:
  19. - 'lib/**.[ch]'
  20. - 'lib/**.cpp'
  21. - 'src/**.[ch]'
  22. - 'src/**.cpp'
  23. - 'irr/**.[ch]'
  24. - 'irr/**.cpp'
  25. - '**/CMakeLists.txt'
  26. - 'cmake/Modules/**'
  27. - 'po/**.po'
  28. - 'util/ci/**'
  29. - '.github/workflows/linux.yml'
  30. env:
  31. MINETEST_POSTGRESQL_CONNECT_STRING: 'host=localhost user=minetest password=minetest dbname=minetest'
  32. jobs:
  33. # Older gcc version (should be close to our minimum supported version)
  34. gcc_9:
  35. runs-on: ubuntu-22.04
  36. steps:
  37. - uses: actions/checkout@v4
  38. - name: Install deps
  39. run: |
  40. source ./util/ci/common.sh
  41. install_linux_deps g++-9
  42. - name: Build
  43. run: |
  44. ./util/ci/build.sh
  45. env:
  46. CC: gcc-9
  47. CXX: g++-9
  48. CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'
  49. - name: Unittest
  50. run: |
  51. ./bin/luanti --run-unittests
  52. # Do this here because we have ASan and error paths are sensitive to dangling pointers
  53. - name: Test error cases
  54. run: |
  55. ./util/test_error_cases.sh
  56. # Current gcc version
  57. gcc_14:
  58. runs-on: ubuntu-24.04
  59. steps:
  60. - uses: actions/checkout@v4
  61. - name: Install deps
  62. run: |
  63. source ./util/ci/common.sh
  64. install_linux_deps g++-14 libluajit-5.1-dev
  65. - name: Build
  66. run: |
  67. ./util/ci/build.sh
  68. env:
  69. CC: gcc-14
  70. CXX: g++-14
  71. # just to check that they compile correctly
  72. CMAKE_FLAGS: '-DBUILD_BENCHMARKS=1'
  73. - name: Test
  74. run: |
  75. mkdir nowrite
  76. chmod a-w nowrite
  77. cd nowrite
  78. ../bin/luanti --run-unittests
  79. # Older clang version (should be close to our minimum supported version)
  80. clang_11:
  81. runs-on: ubuntu-22.04
  82. steps:
  83. - uses: actions/checkout@v4
  84. - name: Install deps
  85. run: |
  86. source ./util/ci/common.sh
  87. install_linux_deps clang-11
  88. - name: Build
  89. run: |
  90. ./util/ci/build.sh
  91. env:
  92. CC: clang-11
  93. CXX: clang++-11
  94. # Test fallback SHA implementations
  95. CMAKE_FLAGS: '-DENABLE_OPENSSL=0'
  96. - name: Test
  97. run: |
  98. ./bin/luanti --run-unittests
  99. # Current clang version
  100. clang_18:
  101. runs-on: ubuntu-24.04
  102. steps:
  103. - uses: actions/checkout@v4
  104. - name: Install deps
  105. run: |
  106. source ./util/ci/common.sh
  107. install_linux_deps clang-18 lldb
  108. - name: Build
  109. run: |
  110. ./util/ci/build.sh
  111. env:
  112. CC: clang-18
  113. CXX: clang++-18
  114. - name: Test
  115. run: |
  116. ./bin/luanti --run-unittests
  117. - name: Integration test + devtest
  118. run: |
  119. ./util/test_multiplayer.sh
  120. # Build with prometheus-cpp (server-only), also runs on ARM64
  121. clang_prometheus_arm:
  122. name: "clang (with Prometheus, ARM64)"
  123. runs-on: ubuntu-24.04-arm
  124. steps:
  125. - uses: actions/checkout@v4
  126. - name: Install deps
  127. run: |
  128. source ./util/ci/common.sh
  129. install_linux_deps --headless clang libluajit-5.1-dev
  130. - name: Build prometheus-cpp
  131. run: ./util/ci/build_prometheus_cpp.sh
  132. - name: Build
  133. run: |
  134. ./util/ci/build.sh
  135. env:
  136. CC: clang
  137. CXX: clang++
  138. CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0 -DENABLE_CURSES=0"
  139. - name: Test
  140. run: |
  141. ./bin/luantiserver --run-unittests