You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
An example project to test and compare different CI (Continuous Integration) services building a C++ project on Linux, Mac, Windows with GCC, Clang (libc++ and libstdc++), MSVC and Clang-cl. It uses Vcpkg for installing dependencies.
Note: This tries to be a simple and robust CI setup that is a comprehensive introduction and is open for improvements. It does not use more advanced configurations like build matrices and instead tries to be a bit more specific (even if that means repetition).
Supported CI services, platforms and Compilers
AppVeyor
Linux:
Clang 14 + libc++
GCC 11 + libstdc++
macOS:
Clang 13 + libc++
GCC 12 + libstdc++
Windows:
MSVC 2022
CircleCI
Linux:
Clang 14 + libc++
Clang 14 + libstdc++
GCC 11 + libstdc++
macOS:
Clang 13 + libc++
Clang 13 + libstdc++
GCC 12 + libstdc++
Windows:
MSVC 2022
Clang-cl
GitHub Actions
Linux:
Clang 14 + libc++
Clang 14 + libstdc++
GCC 12 + libstdc++
macOS:
Clang 13 + libc++
Clang 13 + libstdc++
GCC 12 + libstdc++
Windows:
MSVC 2022
Clang-cl
Travis
No longer supported, since they dropped their free Open Source support.
Example Programs
Note: This project contains example programs that serve no other purpose than being examples. The programs themselves don't make much sense on their own.
src/show_info: Outputs a couple of strings describing the compiler and C++ standard library that were used to build the program.
src/example: Buildsexample (just shows some simple output) andexample_tests (an example for running tests).
Build and Installation Scripts
The.ci directory contains a couple of scripts for installing Vcpkg and building the project.All CI services use these scripts to simplify their configurations.
install-vcpkg.sh /install-vcpkg.ps1: Download and install Vcpkg or update an already existing Vcpkg installation.
build-project.sh /build-project.ps1: Build the project itself.
build-project-with-clang-cl.ps1: Used on Windows to build the project with Clang-cl.
Dependencies
CMake
Vcpkg to install dependencies:
fmtlib
Catch2 + FakeIt
Sanitizers
Where possible all programs are build using Address Sanitizer.
Note: Clang-cl does not support Address Sanitizer inDebug mode. Build withRelWithDebInfo instead.
Example program output
show_info
Output depends on compiler and C++ standard library.
Randomness seeded to: 1486164745===============================================================================All tests passed (16 assertions in 3 test cases)
Pre-installed Software
The CI VMs or Docker images come with already pre-installed software.