Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
- name: Check out repository
uses: actions/checkout@v7

- name: Workspace cache
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: ./.github/actions/workspace-cache

- name: Install Doxygen and Graphviz
run: |
sudo apt-get update
Expand Down Expand Up @@ -68,6 +72,31 @@ jobs:

deactivate

- name: Install C++ compiler and build tools
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git python3-pip clang-format clang-tidy cppcheck
sudo apt-get install -y libcurl4-openssl-dev

- name: Install Conan and gcovr
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: |
source .venv/bin/activate
pip install conan gcovr
conan --version
conan profile detect --force
deactivate

- name: Build unit tests with coverage and generate the report
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: |
source .venv/bin/activate
bash ./tools/shell/build.sh --clean --tests --coverage --no-run
mkdir -p build/site/coverage
cp -r build/Debug/coverage/. build/site/coverage/
deactivate

- name: Upload downloadable site artifact
uses: actions/upload-artifact@v7
with:
Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)

project(cpp-workspace VERSION 0.4.3 LANGUAGES CXX)
project(cpp-workspace VERSION 0.4.4 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -12,6 +12,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

option(CPP_WORKSPACE_BUILD_TESTS "Build unit tests" ON)
option(ENABLE_COVERAGE "Build with gcov instrumentation" OFF)

if(ENABLE_COVERAGE)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(FATAL_ERROR "ENABLE_COVERAGE requires GCC")
endif()
add_compile_options(--coverage -O0 -g)
add_link_options(--coverage)
endif()

message(STATUS "Current source dir: ${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB_RECURSE CORE_SOURCES CONFIGURE_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ source .env; \

```bash
source .venv/bin/activate; \
pip install conan; \
pip install conan gcovr; \
conan --version; \
conan profile detect --force
```
Expand Down
6 changes: 6 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cpp-workspace documentation
===========================

.. toctree::
:maxdepth: 2
:caption: Contents

test_coverage

C++ API reference
-----------------

Expand Down
10 changes: 10 additions & 0 deletions docs/test_coverage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Test coverage
=============

The coverage report is generated from the unit tests on each deployment.

.. raw:: html

<p><a href="coverage/coverage.html">Open the full coverage report</a></p>
<iframe src="coverage/coverage.html" width="100%" height="800"
style="border: 0;"></iframe>
Loading
Loading