Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI using CTest scripts #44

Closed
friendlyanon opened this issue Jan 28, 2022 · 3 comments
Closed

Run CI using CTest scripts #44

friendlyanon opened this issue Jan 28, 2022 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@friendlyanon
Copy link
Owner

This is just an idea, but I like how check-type-align's CI looks. It could be worth considering using these in generated projects' CI.

@friendlyanon friendlyanon added enhancement New feature or request question Further information is requested labels Jan 28, 2022
@ekilmer
Copy link

ekilmer commented Jan 28, 2022

I did not know about this sort of functionality. Cool! I also agree that the referenced CI looks good and makes it easier (even though it's already extremely easy) for people to run what CI runs, locally.

One thing I do like about the currently implemented CI (and something that is lost with the current CTest script implementation) is the separation of steps for both readability of the logs and easily determining which step (configure, build, test) has failed.

Fortunately, with GitHub Actions, there is a way to separate logs within a step using workflow commands, for example:

echo "::group::My title"
echo "Inside group"
echo "::endgroup::"

It requires echoing a command which is interpreted by the runner. However, this means that the actual CTest files will contain more lines of CMake to do this command echoing; and a few more lines if you want to check whether the CI environment variable is set to determine whether you actually echo the commands (in the event you want to support running the same script on a local developer's machine).

Just something to consider!

@friendlyanon
Copy link
Owner Author

Seemed like a great idea, but unfortunately the ordering of the messages is somehow messed up friendlyanon/check-type-align@d3d0538 https://github.com/friendlyanon/check-type-align/actions/runs/1762132747?check_suite_focus=true

@friendlyanon
Copy link
Owner Author

Well that is in fact a real usability/convenience issue. With longer logs I can see it being not as nice to navigate, with normal verbosity you need to upload artifacts to see the actual outputs that require a manual download, unzipping and staring at XML files.

I have added the repository to the examples, so if anyone is curious about that, then it's going to be there.

One additional note about CTest scripts: the ctest_build command allows users to gather the number of warnings from the build output, which can be used to drive some additional tooling that can be used to track this metric over time. This is relevant because of this part in Daniel Pfeifer's talk, which I agree with in that a blanket -Werror or equivalent isn't exactly productive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants