diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e353df2..1dc7b92 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - config: + config: - { name: "ubuntu_latest_gcc_cxx11", os: ubuntu-latest, @@ -63,30 +63,6 @@ jobs: cxx: "g++-11", cxxstd: "20" } - - { - name: "ubuntu_latest_clang11_cxx11", - os: ubuntu-latest, - build_type: "Release", - cc: "clang-11", - cxx: "clang++-11", - cxxstd: "11" - } - - { - name: "ubuntu_latest_clang11_cxx14", - os: ubuntu-latest, - build_type: "Release", - cc: "clang-11", - cxx: "clang++-11", - cxxstd: "14" - } - - { - name: "ubuntu_latest_clang12_cxx14", - os: ubuntu-latest, - build_type: "Release", - cc: "clang-12", - cxx: "clang++-12", - cxxstd: "14" - } - { name: "ubuntu22_clang13_cxx17", os: ubuntu-22.04, @@ -145,14 +121,14 @@ jobs: shell: bash working-directory: tests run: | - export SHOULD_RUN_COVERAGE="y" - ./cov_check - cd .. - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import - curl -Os https://uploader.codecov.io/latest/linux/codecov - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig - gpgv codecov.SHA256SUM.sig codecov.SHA256SUM - shasum -a 256 -c codecov.SHA256SUM - chmod +x codecov - ./codecov + sudo apt-get install lcov + lcov --directory . --capture --output-file coverage.info + + - name: Upload to Codecov + if: startsWith(matrix.config.build_type, 'Coverage') + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + name: gcem + files: ${{ runner.workspace }}/tests/coverage.info + verbose: true diff --git a/CMakeLists.txt b/CMakeLists.txt index d71526c..79c419f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ ## ################################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.31) project(gcem) set(GCEM_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include) @@ -43,7 +43,7 @@ message(STATUS "GCE-Math version ${${PROJECT_NAME}_VERSION}") if(NOT MSVC) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - + if(COMPILER_SUPPORTS_CXX11) message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.") else() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2378b57..beddf78 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,7 +18,7 @@ ## ################################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.31) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) project(gcem-test) @@ -35,7 +35,7 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) if(NOT MSVC) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - + if(COMPILER_SUPPORTS_CXX11) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -O0 -Wall -Wextra --coverage -fno-inline -fno-inline-small-functions -fno-default-inline") @@ -66,7 +66,7 @@ foreach( file_ ${GCEM_TESTS} ) add_executable( ${testname} EXCLUDE_FROM_ALL ${filename} ) target_link_libraries( ${testname} gcem ) - + list(APPEND GCEM_TESTS_EX ${testname}) endforeach() diff --git a/tests/cov_check b/tests/cov_check deleted file mode 100755 index d844fcb..0000000 --- a/tests/cov_check +++ /dev/null @@ -1,22 +0,0 @@ - -echo "SHOULD_RUN_COVERAGE: ${SHOULD_RUN_COVERAGE}" - -if [[ "${SHOULD_RUN_COVERAGE}" == "y" ]]; then - - if [ -z ${CCOV+x} ]; then - CCOV=gcov - fi - - echo "CCOV set to ${CCOV}" - - for t in ./*.cpp; do - $CCOV "$t" > /dev/null 2>&1 - done - - ./pow.test > /dev/null 2>&1 - $CCOV pow.cpp > /dev/null 2>&1 - ./exp.test > /dev/null 2>&1 - $CCOV exp.cpp > /dev/null 2>&1 - ./log.test > /dev/null 2>&1 - $CCOV log.cpp > /dev/null 2>&1 -fi diff --git a/tests/run_tests b/tests/run_tests index 10f0e48..9d28fda 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -1,3 +1,4 @@ +#!/bin/bash for t in ./*.test; do "$t"