DEV Community

Cover image for GitHub CMake cross-compile action workflow example
Artak Avetyan
Artak Avetyan

Posted on

GitHub CMake cross-compile action workflow example

For my C++ project at GitHub i wanted to create an action workflow to compile sources. At first, i used the CMake workflow template offered by GitHub (those who are not familiar much with GitHub, in Actions tab select New Workflow), and compiled only with GCC under Linux.
AREG SDK GitHub Action workflow

But the agenda was to compile sources using multiple compilers and platforms. Since I was not familiar with YAML, I started to search and looked many examples of complex workflows to combine in one file. The alternative would be creating one workflow per compilation, which I considered not much efficient. Finally, I've created an action workflow, which compiles with gcc/g++, clang/clang++ and msvc under Linux (Ubuntu), Windows and even Cygwin. Here I share the link to the CMake Workflow. I find it very useful, helps to save time to check cross-compilation after every push. Can be useful and good example for other projects.

Top comments (0)