Skip to content

Commit

Permalink
Merge pull request #11 from franneck94/fixCobutera
Browse files Browse the repository at this point in the history
roprder params
  • Loading branch information
franneck94 authored Mar 10, 2024
2 parents f315581 + 7066082 commit 56080ad
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
make prepare
- name: configure
run: |
cmake -H. -Bbuild -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug"
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE="Debug"
- name: building and testing
run: |
ctest --build-and-test
cmake --build build --config Debug
cd build
ctest .
9 changes: 5 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ jobs:
make prepare
- name: configure
run: |
cmake -H. -Bbuild -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
- name: building and testing
run: |
ctest --build-and-test
cmake --build build --config Debug --target coverage -j4
cd build
ctest .
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/**/summary_cobertura.xml
filename: build/coverage/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
Expand All @@ -35,7 +37,6 @@ jobs:
indicators: true
output: both
thresholds: '60 80'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
cmake -H"." -Bbuild -T host=x86 -A x64 -DCMAKE_BUILD_TYPE="Debug"
- name: building and testing
run: |
ctest --build-and-test
cmake --build build --config Debug
cd build
ctest .
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# Template For C++ Projects

![C++](https://img.shields.io/badge/C%2B%2B-11%2F14%2F17%2F20%2F23-blue)
![License](https://camo.githubusercontent.com/890acbdcb87868b382af9a4b1fac507b9659d9bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)
![License](https://img.shields.io/github/license/franneck94/CppProjectTemplate)
![Linux Build](https://github.com/franneck94/CppProjectTemplate/workflows/Ubuntu%20CI%20Test/badge.svg)
[![codecov](https://codecov.io/gh/franneck94/CppProjectTemplate/branch/master/graph/badge.svg)](https://codecov.io/gh/franneck94/CppProjectTemplate)

This is a template for C++ projects. What you get:

- Library, executable and test code separated in distinct folders
- Use of modern CMake for building and compiling
- External libraries installed and managed by
- [CPM](https://github.com/cpm-cmake/CPM.cmake) Package Manager OR
- [Conan](https://conan.io/) Package Manager OR
- [CPM](https://github.com/cpm-cmake/CPM.cmake) Package Manager **OR**
- [Conan](https://conan.io/) Package Manager **OR**
- [VCPKG](https://github.com/microsoft/vcpkg) Package Manager
- Unit testing using [Catch2](https://github.com/catchorg/Catch2) v2
- General purpose libraries: [JSON](https://github.com/nlohmann/json), [spdlog](https://github.com/gabime/spdlog), [cxxopts](https://github.com/jarro2783/cxxopts) and [fmt](https://github.com/fmtlib/fmt)
- Continuous integration testing with Github Actions and [pre-commit](https://pre-commit.com/)
- Code coverage reports, including automatic upload to [Codecov](https://codecov.io)
- Code documentation with [Doxygen](https://doxygen.nl/) and [Github Pages](https://franneck94.github.io/CppProjectTemplate/)
- Tooling: Clang-Format, Cmake-Format, Clang-tidy, Sanitizers

Expand All @@ -37,11 +35,11 @@ This is a template for C++ projects. What you get:
│ ├── ...
├── src
│ ├── CMakesLists.txt
│ ├── foo/
│ └── bar/
│ ├── foo/...
│ └── bar/...
└── tests
├── CMakeLists.txt
└── main.cc
└── test_*.cc
```

Library code goes into [src/](src/), main program code in [app/](app) and tests go in [tests/](tests/).
Expand All @@ -62,7 +60,7 @@ First, clone this repo and do the preliminary work:

```shell
git clone --recursive https://github.com/franneck94/CppProjectTemplate
make prepare
mkdir build
```

- App Executable
Expand All @@ -78,11 +76,10 @@ cd app
- Unit testing

```shell
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE="Debug"
cmake --build build --config Debug
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target unit_tests
cd tests
./unit_tests
ctest .
```

- Documentation
Expand All @@ -96,9 +93,10 @@ cmake --build . --config Debug --target docs
- Code Coverage (Unix only)

```shell
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
cmake --build build --config Debug --target coverage -j4
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
cmake --build . --config Debug --target coverage
ctest .
```

For more info about CMake see [here](./README_cmake.md).
4 changes: 2 additions & 2 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ function(setup_target_for_coverage_gcovr_html)
--json-summary
${Coverage_NAME}/summary.json
--json-summary-pretty
--cobertura-pretty
${Coverage_NAME}/summary_cobertura.xml
--cobertura
${Coverage_NAME}/coverage.cobertura.xml
--cobertura-pretty
--decisions
-r
${BASEDIR}
Expand Down

0 comments on commit 56080ad

Please sign in to comment.