ci.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. name: CI
  2. on: [ push, pull_request ]
  3. env:
  4. # Enable format attributes in ncurses headers
  5. # Enable fortified memory/string handling
  6. CPPFLAGS: -DGCC_PRINTF -DGCC_SCANF -D_FORTIFY_SOURCE=2
  7. jobs:
  8. build-ubuntu-latest-minimal-gcc:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. - name: Install Dependencies
  13. run: sudo apt-get install --no-install-recommends libncursesw5-dev
  14. - name: Bootstrap
  15. run: ./autogen.sh
  16. - name: Configure
  17. run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors || (cat config.log; exit 1)
  18. - name: Enable compatibility modes
  19. run: |
  20. sed -i 's/#define HAVE_FSTATAT 1/#undef HAVE_FSTATAT/g' config.h
  21. sed -i 's/#define HAVE_OPENAT 1/#undef HAVE_OPENAT/g' config.h
  22. sed -i 's/#define HAVE_READLINKAT 1/#undef HAVE_READLINKAT/g' config.h
  23. - name: Build
  24. run: make -k
  25. - name: Distcheck
  26. run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
  27. build-ubuntu-latest-minimal-clang:
  28. runs-on: ubuntu-latest
  29. env:
  30. CC: clang-18
  31. steps:
  32. - uses: actions/checkout@v4
  33. - name: install clang repo
  34. run: |
  35. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
  36. sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
  37. sudo apt-get update -q
  38. - name: Install Dependencies
  39. run: sudo apt-get install --no-install-recommends clang-18 libncursesw5-dev
  40. - name: Bootstrap
  41. run: ./autogen.sh
  42. - name: Configure
  43. run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors || ( cat config.log; exit 1; )
  44. - name: Build
  45. run: make -k
  46. - name: Distcheck
  47. run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
  48. build-ubuntu-latest-full-featured-gcc:
  49. runs-on: ubuntu-latest
  50. # Enable LTO, might trigger additional warnings on advanced inlining
  51. env:
  52. CFLAGS: -O3 -g -flto
  53. LDFLAGS: -O3 -g -flto -Wl,--as-needed
  54. steps:
  55. - uses: actions/checkout@v4
  56. - name: Install Dependencies
  57. run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
  58. - name: Bootstrap
  59. run: ./autogen.sh
  60. - name: Configure
  61. run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
  62. - name: Build
  63. run: make -k
  64. - name: Distcheck
  65. run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
  66. build-ubuntu-latest-full-featured-clang:
  67. runs-on: ubuntu-latest
  68. env:
  69. CC: clang-18
  70. steps:
  71. - uses: actions/checkout@v4
  72. - name: install clang repo
  73. run: |
  74. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
  75. sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
  76. sudo apt-get update -q
  77. - name: Install Dependencies
  78. run: sudo apt-get install --no-install-recommends clang-18 libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
  79. - name: Bootstrap
  80. run: ./autogen.sh
  81. - name: Configure
  82. run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
  83. - name: Build
  84. run: make -k
  85. - name: Distcheck
  86. run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
  87. build-ubuntu-latest-gcc-static:
  88. runs-on: ubuntu-latest
  89. # Enable LTO, might trigger additional warnings on advanced inlining
  90. env:
  91. CFLAGS: -O3 -g -flto
  92. LDFLAGS: -O3 -g -flto
  93. steps:
  94. - uses: actions/checkout@v4
  95. - name: Install Dependencies
  96. run: sudo apt-get install --no-install-recommends libncursesw5-dev libtinfo-dev libgpm-dev libsensors4-dev libcap-dev
  97. - name: Bootstrap
  98. run: ./autogen.sh
  99. - name: Configure
  100. run: ./configure --enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
  101. - name: Build
  102. run: make -k
  103. - name: Distcheck
  104. run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities'
  105. build-ubuntu-latest-pcp:
  106. # we want PCP v5.2.3+
  107. runs-on: ubuntu-22.04
  108. steps:
  109. - uses: actions/checkout@v4
  110. - name: Install Dependencies
  111. run: sudo apt-get install --no-install-recommends libpcp3-dev libncursesw5-dev libtinfo-dev libgpm-dev
  112. - name: Bootstrap
  113. run: ./autogen.sh
  114. - name: Configure
  115. run: ./configure --enable-werror --enable-pcp --enable-unicode || ( cat config.log; exit 1; )
  116. - name: Build
  117. run: make -k
  118. build-ubuntu-latest-clang-analyzer:
  119. runs-on: ubuntu-latest
  120. env:
  121. CC: clang-18
  122. steps:
  123. - uses: actions/checkout@v4
  124. - name: install clang repo
  125. run: |
  126. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
  127. sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
  128. sudo apt-get update -q
  129. - name: Install Dependencies
  130. run: sudo apt-get install --no-install-recommends clang-18 clang-tools-18 libncursesw5-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
  131. - name: Bootstrap
  132. run: ./autogen.sh
  133. - name: Configure
  134. run: scan-build-18 -analyze-headers --status-bugs ./configure --enable-debug --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
  135. - name: Build
  136. run: scan-build-18 -analyze-headers --status-bugs make -j"$(nproc)"
  137. build-ubuntu-latest-clang-sanitizer:
  138. runs-on: ubuntu-latest
  139. env:
  140. CC: clang-18
  141. CFLAGS: '-O1 -g -ftrivial-auto-var-init=pattern -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-address-use-after-return=always -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
  142. LDFLAGS: '-ftrivial-auto-var-init=pattern -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-address-use-after-return=always -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
  143. ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
  144. UBSAN_OPTIONS: print_stacktrace=1:print_summary=1:halt_on_error=1
  145. TERM: xterm-color
  146. HTOPRC: .github/workflows/htoprc
  147. steps:
  148. - uses: actions/checkout@v4
  149. - name: install clang repo
  150. run: |
  151. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
  152. sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' -y
  153. sudo apt-get update -q
  154. - name: Install LLVM Toolchain
  155. run: sudo apt-get install --no-install-recommends clang-18 libclang-rt-18-dev llvm-18
  156. - name: Install Dependencies
  157. run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
  158. - name: Bootstrap
  159. run: ./autogen.sh
  160. - name: Configure
  161. run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
  162. - name: Build
  163. run: make -k
  164. - name: Run sanitized htop (1)
  165. run: ./htop -h
  166. - name: Run sanitized htop (2)
  167. run: ./htop -n 5
  168. - name: Run sanitized htop (3)
  169. run: ./htop -n 5 -t
  170. - name: Run sanitized htop (4)
  171. run: ./htop -d 1 -n 50
  172. build-macos-latest-clang:
  173. runs-on: macOS-latest
  174. env:
  175. CC: clang
  176. steps:
  177. - uses: actions/checkout@v4
  178. - name: Install Dependencies
  179. run: brew install automake pkg-config
  180. - name: Bootstrap
  181. run: ./autogen.sh
  182. - name: Configure
  183. run: ./configure --enable-werror || ( cat config.log; exit 1; )
  184. - name: Build
  185. run: make -k
  186. - name: Distcheck
  187. run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror"
  188. build-dragonflybsd-latest-gcc:
  189. runs-on: ubuntu-22.04
  190. timeout-minutes: 20
  191. steps:
  192. - uses: actions/checkout@v4
  193. with:
  194. submodules: recursive
  195. - name: Compile
  196. uses: vmactions/dragonflybsd-vm@v1
  197. with:
  198. release: '6.4.0'
  199. usesh: true
  200. prepare: |
  201. pkg install -y gmake autoconf automake ncurses git
  202. git config --global --add safe.directory /home/runner/work/htop/htop
  203. run: |
  204. set -e
  205. export LDFLAGS="-L/usr/local/lib"
  206. export CFLAGS="-I/usr/local/include"
  207. ./autogen.sh
  208. ./configure --enable-unicode --enable-werror
  209. gmake -k
  210. build-freebsd-latest-clang:
  211. runs-on: ubuntu-22.04
  212. timeout-minutes: 20
  213. steps:
  214. - uses: actions/checkout@v4
  215. with:
  216. submodules: recursive
  217. - name: Compile
  218. uses: vmactions/freebsd-vm@v1
  219. with:
  220. release: '14.1'
  221. usesh: true
  222. prepare: |
  223. pkg install -y gmake autoconf automake pkgconf git
  224. git config --global --add safe.directory /home/runner/work/htop/htop
  225. run: |
  226. set -e
  227. ./autogen.sh
  228. ./configure --enable-unicode --enable-werror
  229. gmake -k
  230. build-netbsd-latest-gcc:
  231. runs-on: ubuntu-22.04
  232. timeout-minutes: 20
  233. steps:
  234. - uses: actions/checkout@v4
  235. with:
  236. submodules: recursive
  237. - name: Compile
  238. uses: vmactions/netbsd-vm@v1
  239. with:
  240. release: '10.0'
  241. usesh: true
  242. prepare: |
  243. PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
  244. PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.0/All/"
  245. export PATH PKG_PATH
  246. /usr/sbin/pkg_add pkgin
  247. pkgin -y install autoconf automake libtool ncurses pkg-config gmake git
  248. git config --global --add safe.directory /home/runner/work/htop/htop
  249. run: |
  250. set -e
  251. ./autogen.sh
  252. ./configure --enable-unicode --enable-werror
  253. gmake -k
  254. build-openbsd-latest-clang:
  255. runs-on: ubuntu-22.04
  256. timeout-minutes: 20
  257. steps:
  258. - uses: actions/checkout@v4
  259. with:
  260. submodules: recursive
  261. - name: Compile
  262. uses: vmactions/openbsd-vm@v1
  263. with:
  264. release: '7.4'
  265. usesh: true
  266. prepare: |
  267. pkg_add gmake git
  268. git config --global --add safe.directory /home/runner/work/htop/htop
  269. run: |
  270. set -e
  271. autoconf_version_full=$(pkg_info -Q autoconf |
  272. LC_ALL=C sed 's/^autoconf-\([0-9]*\.[0-9]*\)\(p[.0-9]*\)\{0,1\}$/\1\2/p; d' |
  273. LC_ALL=C sort -n -r -t . -k 1,1 -k 2,2 |
  274. sed '1 q')
  275. automake_version_full=$(pkg_info -Q automake |
  276. LC_ALL=C sed 's/^automake-\([0-9]*\.[0-9]*\)\(\.[0-9]*\)\{0,1\}\(p[0-9]*\)\{0,1\}$/\1\2\3/p; d' |
  277. LC_ALL=C sort -n -r -t . -k 1,1 -k 2,2 -k 3,3 |
  278. sed '1 q')
  279. pkg_add -v autoconf-${autoconf_version_full} automake-${automake_version_full}
  280. export AUTOCONF_VERSION=$(echo ${autoconf_version_full} |
  281. LC_ALL=C sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')
  282. # Must not include the third version field in $AUTOMAKE_VERSION
  283. export AUTOMAKE_VERSION=$(echo ${automake_version_full} |
  284. LC_ALL=C sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')
  285. ./autogen.sh
  286. ./configure --enable-unicode --enable-werror
  287. gmake -k
  288. build-solaris-latest-gcc:
  289. runs-on: ubuntu-22.04
  290. timeout-minutes: 20
  291. steps:
  292. - uses: actions/checkout@v4
  293. with:
  294. submodules: recursive
  295. - name: Compile
  296. uses: vmactions/solaris-vm@v1
  297. with:
  298. release: '11.4'
  299. usesh: true
  300. prepare: |
  301. pkg install gnu-make autoconf automake ncurses git gcc
  302. git config --global --add safe.directory /home/runner/work/htop/htop
  303. run: |
  304. set -e
  305. ./autogen.sh
  306. ./configure --enable-unicode --enable-werror
  307. gmake -k
  308. lint-whitespace:
  309. runs-on: ubuntu-latest
  310. steps:
  311. - uses: actions/checkout@v4
  312. - name: check-whitespaces
  313. run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
  314. lint-pcp-config:
  315. runs-on: ubuntu-latest
  316. steps:
  317. - uses: actions/checkout@v4
  318. - name: check-pcp-style
  319. run: ./check-pcp-style.sh