linux.yml 3.6 KB

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