diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52352601..e6ee390f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,5 +20,15 @@ jobs: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 - name: Build and unit test run: | - NUMPROC=2 make debug + NUMPROC=2 CMAKE_CXX_FLAGS="--coverage -fno-inline" make debug make test + - name: Run coverage + run: | + lcov --no-external --directory src -c -d debug -o coverage.info + lcov -l coverage.info + - name: Upload coverage + uses: codecov/codecov-action@v2 + with: + files: coverage.info + name: clang-uml + fail_ci_if_error: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index b474bd93..cb62a1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ bin/ /.cache docs/diagrams +coverage.info + # CLion diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dd72aca..912da58a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ set(LLVM_PREFERRED_VERSION 12.0.0) find_package(LibClang REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 ${LIBCLANG_CXXFLAGS}") +message(STATUS "Using CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") # Thirdparty sources set(THIRDPARTY_HEADERS_DIR ${PROJECT_SOURCE_DIR}/thirdparty/) diff --git a/Makefile b/Makefile index 1eebfe73..09933fdb 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ NUMPROC ?= $(shell nproc) LLVM_CONFIG_PATH ?= +CMAKE_CXX_FLAGS ?= .PHONY: clean clean: @@ -32,6 +33,7 @@ debug/CMakeLists.txt: cmake -S . -B debug \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_FLAGS="$(CMAKE_CXX_FLAGS)" \ -DLLVM_CONFIG_PATH=$(LLVM_CONFIG_PATH) release/CMakeLists.txt: diff --git a/README.md b/README.md index 901341ba..5eda7cba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # clang-uml - C++ UML diagram generator based on Clang and PlantUML -![linux build](https://github.com/bkryza/clang-uml/actions/workflows/build.yml/badge.svg) +[![Build status]](https://github.com/bkryza/clang-uml/actions/workflows/build.yml/badge.svg) +[![Coverage](https://codecov.io/gh/bkryza/clang-uml/branch/master/graph/badge.svg)](https://codecov.io/gh/bkryza/clang-uml) `clang-uml` is an automatic C++ to [PlantUML](https://plantuml.com) class, sequence and package diagram generator, driven by YAML configuration files. The main idea behind the