I've made a branch in reproc that changes one of my CMake invocations to use a folded multiline string on Ubuntu and macOS:
I want to use folding to avoid the platform specific command continuation character ('\' on Linux/macOS bash, '^' on Windows cmd). Using folding, all newlines get converted to spaces which removes the need for the platform specific continuation character.
Unfortunately, we can see that all Ubuntu and macOS builds fail in the Configure step due to folded multiline strings being interpreted as multiple commands (at least that seems to be what's going on).
Currently the run step just takes the multi-line contents and writes that to a file that is then executed using the specified shell program. The parser does not make any decisions based on the particular type of multi-line specifier in the YAML.
Unfortunately I think we may have an issue where changing that behavior now will potentially cause workflow files that are currently working to break.
I realize that a Beta is not supposed to break stuff but it would be rather convenient if this could still be changed while Github Actions is still in Beta.
Of course, your team has a way better view on how much stuff is already depending on this behavior than me so I understand if it's not possible to change this anymore.
@DaanDeMeyer could you try formatting your command like this and see if you still see the issue
- run: >- cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DREPROC++=ON -DREPROC_TEST=ON -DREPROC_EXAMPLES=ON -DREPROC_WARNINGS_AS_ERRORS=ON -DREPROC_TIDY=ON -DREPROC_SANITIZERS=ON
I think the extra level of indent is informing the YAML parser to add additional new line characters.
To elaborate on the syntax here a bit more, this is one of the odder parts of the YAML specification:
[scalar content] can be written with the folded style (denoted by “>”) where each line break is folded to a space unless it ends an empty or a more-indented line.https://yaml.org/spec/1.2/spec.html#id2760844
It's on yaml-multiline.info, too, but to be honest I've never actually read the paragraph on that page where it happens to mention this 😂
I agree, this doesn't exactly seem intuitive for a config language. Hopefully this thread helps others that encounter the same issue.