lukka / run-cmake

GitHub Action to build C++ applications with CMake (CMakePresets.json), Ninja and vcpkg on GitHub.
MIT License
181 stars 19 forks source link

Integrating CMake actions with CDash and CTest #73

Closed mcraveiro closed 2 years ago

mcraveiro commented 2 years ago

Hi @lukka,

Thanks very much for an extremely useful set of actions. I am on the process of porting my project's aging Travis IaC infrastructure [1] to the brand new world of GitHub actions and I started by using your code. I very quickly got something up and running with great vcpkg support [2] but I then ran into a problem. In the past I made use of CDash quite a lot for dashboards [3]. This allowed us to view detail stats of the CI builds. It worked via a CTest script [4], though it was by no means perfect.

I've been trying to integrate that with your actions, but I have now begun to think this is not a good idea because the approaches seem to be quite different. I am now thinking about making a copy & paste action of your run-cmake action but just have it execute a CTest script. Do you think this is a good idea? Or would it perhaps make more sense for your test step to allow users to supply a script via -S script_name?

Any ideas on this would be greatly appreciated :-)

Many thanks for your time.

Marco

[1] https://github.com/MASD-Project/dogen/blob/master/.travis.yml

[2] https://github.com/MASD-Project/dogen/blob/master/.github/workflows/build-vcpkg.yml

[3] https://my.cdash.org/index.php?project=MASD+Project+-+Dogen

[4] https://github.com/MASD-Project/dogen/blob/master/CTestConfig.cmake

[5] https://gitlab.kitware.com/cmake/cmake/-/issues/23383

mcraveiro commented 2 years ago

Actually, after spending some hours trying to integrate presets with CTest scripts, I do not think this works that well at present. Seems like the "stand-alone" approach used by run-cmake is orthogonal to CTest scripts, and if you need both there needs to be an element of copying and pasting :-( I will continue my investigations on [1], but I do not think its a good idea to make use of this as a GitHub Action. I'll close the ticket for now.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/23383

lukka commented 2 years ago

@mcraveiro using cmake or ctest in 'run script' mode is a different scenario than consuming a CMakePresets.json file, and the run-cmake is targeted for the latter scenario. For the former scenario I'd suggest to directly launch the command, e.g. run: ctest -S .... Probably you may need to run vcpkg and cmake before running ctest -S to implement a "build and then test" workflow.