Show HN: Simplify the CI of your CMake-based project with this script

by amadioon 3/10/2024, 8:55 AMwith 0 comments

This is not quite a project, but I think this is useful enough to be posted here. It's a simple CMake script you can drop at the top level of your own CMake-based project to perform the tedious bits of the configure/build/test cycle. CMake unfortunately doesn't set sane defaults for you when running via CTest (most annoying of which is the CMake generator), so the script serves to detect said defaults. The script works as a CDash dashboard submitter as well. It supports enabling clang-tidy, memcheck, coverage, customizations, etc, in a simple manner. If you want to try it out, just drop the script at the top level of your project, create a CTestConfig.cmake and .ci/config.cmake (optional) as appropriate, make sure to include(CTest) at your top level CMakeLists.txt, then call

ctest -VV -S test.cmake

If you don't have a CMake project to try it out, just use XRootD itself. The docs on how to use this script are here: https://github.com/xrootd/xrootd/blob/master/docs/TESTING.md

You can also see how the GitHub Actions workflows look like when using this script here: https://github.com/xrootd/xrootd/blob/master/.github/workflo...

I hope you enjoy!

0