linux.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. - '**/CMakeLists.txt'
  25. - 'cmake/Modules/**'
  26. - 'util/ci/**'
  27. - 'Dockerfile'
  28. - '.dockerignore'
  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_7:
  35. runs-on: ubuntu-20.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++-7
  42. - name: Build
  43. run: |
  44. ./util/ci/build.sh
  45. env:
  46. CC: gcc-7
  47. CXX: g++-7
  48. - name: Test
  49. run: |
  50. ./bin/minetest --run-unittests
  51. # Current gcc version
  52. gcc_12:
  53. runs-on: ubuntu-22.04
  54. steps:
  55. - uses: actions/checkout@v4
  56. - name: Install deps
  57. run: |
  58. source ./util/ci/common.sh
  59. install_linux_deps g++-12 libluajit-5.1-dev
  60. - name: Build
  61. run: |
  62. ./util/ci/build.sh
  63. env:
  64. CC: gcc-12
  65. CXX: g++-12
  66. - name: Test
  67. run: |
  68. mkdir nowrite
  69. chmod a-w nowrite
  70. cd nowrite
  71. ../bin/minetest --run-unittests
  72. # Older clang version (should be close to our minimum supported version)
  73. clang_7:
  74. runs-on: ubuntu-20.04
  75. steps:
  76. - uses: actions/checkout@v4
  77. - name: Install deps
  78. run: |
  79. source ./util/ci/common.sh
  80. install_linux_deps clang-7 llvm
  81. - name: Build
  82. run: |
  83. ./util/ci/build.sh
  84. env:
  85. CC: clang-7
  86. CXX: clang++-7
  87. CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'
  88. - name: Unittest
  89. run: |
  90. ./bin/minetest --run-unittests
  91. # Current clang version
  92. clang_14:
  93. runs-on: ubuntu-22.04
  94. steps:
  95. - uses: actions/checkout@v4
  96. - name: Install deps
  97. run: |
  98. source ./util/ci/common.sh
  99. install_linux_deps clang-14 lldb
  100. - name: Build
  101. run: |
  102. ./util/ci/build.sh
  103. env:
  104. CC: clang-14
  105. CXX: clang++-14
  106. - name: Test
  107. run: |
  108. ./bin/minetest --run-unittests
  109. - name: Integration test + devtest
  110. run: |
  111. ./util/test_multiplayer.sh
  112. # Build with prometheus-cpp (server-only)
  113. clang_9_prometheus:
  114. name: "clang_9 (PROMETHEUS=1)"
  115. runs-on: ubuntu-20.04
  116. steps:
  117. - uses: actions/checkout@v4
  118. - name: Install deps
  119. run: |
  120. source ./util/ci/common.sh
  121. install_linux_deps clang-9
  122. - name: Build prometheus-cpp
  123. run: |
  124. ./util/ci/build_prometheus_cpp.sh
  125. - name: Build
  126. run: |
  127. ./util/ci/build.sh
  128. env:
  129. CC: clang-9
  130. CXX: clang++-9
  131. CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0"
  132. - name: Test
  133. run: |
  134. ./bin/minetestserver --run-unittests