Remaking the Cmake and the CI to clean up

This commit is contained in:
AnonymusRaccoon
2020-01-23 10:30:14 +01:00
parent 4e6733f4e9
commit e5af2bb6e8
4 changed files with 12 additions and 16 deletions
+2 -2
View File
@@ -12,9 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Build Makefile with CMake
run: cmake .
run: cmake -S . -B build
- name: Build with Makefile
run: make
run: make -C build ComSquare
- name: Archive production artifact
uses: actions/upload-artifact@v1
with:
+3 -3
View File
@@ -22,11 +22,11 @@ jobs:
- name: Install Gcovr
run: python -m pip install --upgrade pip gcovr
- name: Build Makefile with CMake
run: cmake -DTEST=on .
run: cmake -S . -B build
- name: Build with Makefile
run: make
run: make -C build unit_tests
- name: Execute tests
run: ./unit_tests
run: .build/unit_tests
- name: Output coverage
run: gcovr -e tests/ -o coverage.xml --xml
- name: Publish to CodeCov
+7 -11
View File
@@ -7,16 +7,12 @@ project(ComSquare)
# show compilation warnings
add_compile_options(-W -Wall -Wextra -Wshadow)
if (TEST)
# make unit tests
add_executable(unit_tests sources/hello.cpp tests/hello.cpp)
# make unit tests
add_executable(unit_tests sources/hello.cpp tests/hello.cpp)
# include criterion & coverage
target_link_libraries(unit_tests criterion -lgcov)
target_compile_options(unit_tests PUBLIC -fprofile-arcs -ftest-coverage -g -O0)
# include criterion & coverage
target_link_libraries(unit_tests criterion -lgcov)
target_compile_options(unit_tests PUBLIC -fprofile-arcs -ftest-coverage)
else (TEST)
# make app
add_executable(ComSquare sources/main.cpp sources/hello.cpp)
endif (TEST)
# make app
add_executable(ComSquare main.cpp sources/hello.cpp)
View File