Is there a way to set up github actions that compile a C++ project and produce a binary on OS X and Windows?
This would be straightforward on linux where it could be done with a Docker action, but according to the documentation OS X and Windows only support JavaScript actions. Is there a way to set up and run build environments from JavaScript actions? And any open source examples?
While I don't yet know of any open source examples of Windows and Mac builds using GitHub Actions, https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions has a complete list of the software available in Windows and OS X virtual environments for GitHub Actions, and it includes all the software build tools you might need for building C++: Visual Studio on Windows, and Xcode on OS X. So whatever build process you would normally do on Windows or OS X is probably available. (I'm afraid I can't go into more detail here because I don't do Windows and OS X development so I don't know the tools in depth).
Also, if you haven't seen https://github.com/actions/starter-workflows/blob/master/ci/c-cpp.yml yet, that's at least a minimal starting point even though it's not the full-fledged example you were looking for. To build on Windows or OS X, replace the ubuntu-latest environment with windows-latest or macOS-latest; see https://help.github.com/en/articles/virtual-environments-for-github-actions for the complete list.
Disclaimer: I haven't gotten into the beta for GitHub Actions yet, so I can't actually test things and give you more detailed answers; I can only tell you what I've understood from the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With