cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider adding `set -x` to Github Actions workflows

ddalcino opened this issue · comments

If we use set -x, we can better understand the output of the GH Actions workflows and make it easier to debug them.

GH Actions allows you to set global defaults for choice of shell with the defaults.run option. It would be nice if you could use this option to run set -x before every block, but it doesn't look like it works that way.

I think that a reasonable way to accomplish this would be to set a global environment variable, like bash_settings_cmd="set -x", and then add an eval "${bash_settings_cmd}" to the top of every block of bash code. This makes it easy to modify or override the command. Unfortunately, if a user needs to adapt the workflow to run somewhere that bash is not available, as mentioned in #165 (comment), that user would need to modify every block of code.

Originally posted by @ddalcino in #165 (comment)

Edit: The default shell in .github/workflows/build_cmake.yml is already set to bash, so all blocks of shell script will run in bash, regardless of platform. We do not need to add defaults: run: shell: bash.

This issue has been open for over two months, with no feedback and no activity. I think it's safe to say that this issue has been considered, and the feature has been judged unnecessary.

If anyone disagrees with my assessment, please comment here and I will reopen the issue.