With https://github.community/t5/GitHub-Actions/YAML-folded-multiline-strings-interpreted-as-multiple-commands/m-p/30876#M593 solved, the only thing standing in the way of reusing a lot of commands between Linux/MacOS and Windows when building C++ with CMake is an option to keep environment variables between steps (currently the environment is reset after each step).
For example, an option
transfer-env that, when enabled, saves the environment after each step and restores it in the next step would allow me to remove a lot of duplicate code from reproc’s (https://github.com/DaanDeMeyer/reproc/blob/master/.github/workflows/main.yml) and doctest’s WIP (https://github.com/DaanDeMeyer/doctest/blob/github-actions/.github/workflows/main.yml) Github Actions configs.
I’ve seen that it’s possible to set global environment variables with
exportVariable in https://github.com/actions/toolkit which makes me think that adding this is possible. If possible I’d try to implement it myself but I do not think the relevant code is open source.