Continuous Integration Demo
March 17, 2021 ยท View on GitHub
THIS REPO IS COMPLETELY OUT OF DATE AND REFLECTS MY KNOWLEGDE ABOUT CMAKE FROM SOME YEARS AGO
Please read Craig Scott's "Professional CMake: A Practical Guide" instead of trying to find answers here.
Continuous Integration Demo
This project serves as an example for
- how to use CMake for a C++14 project
- how to use Google Test for a C++14 project
- how to use the Catch Unit Test Framework
- how to configure Travis CI
- how to configure Circle CI
- Some parts use a Docker image to shorten setup time during test runs
- how to configure CMake/CPack to create a Debian package and source packages
Make a Duplicate
If you want to use this code in your own project, please follow the advice on how to make a duplicate. In short:
git clone --bare https://github.com/daixtrose/continuous-integration-demo.git
cd continuous-integration-demo.git
git push --mirror https://github.com/youraccount/new-repository.git
Do not forget to change the links to the build status icons on the top of README.md!
Local Usage
Retrieve this repository
git clone --recursive https://github.com/daixtrose/continuous-integration-demo
cd continuous-integration-demo
Prepare for a build
mkdir build
cd build
cmake ..
Build
make
Test
Execute
make test
or
ctest -VV
for some detailed information.
Package Creation
make package
make package_source
Some Comments
Download of External Projects via CMake
- This repo makes use of the CMake module DownloadProject in order to download and build Google Test on the fly
About TravisCI
- Hint: TravisCI can additionally be configured not to run on commits in branches unless those are under a pull request
- Caveats: Travis CI only knows the status
build passingorbuild failing, but this is misleading: A build failure is even reported in case the build succeeds and one single unit test fails. So I consider Travis CI to be a Continuous Deployment environment in the first place - with CI capability, of course. - Comment: IMHO the C++ integration is somewhat tricky. At the time of this writing (August 2017) Travis uses Ubuntu-14.04 (not version 16.04 or higher) which adds extra headache with regard to the available CMake version. See how others are installing a newer version of CMake before going on with the build.
