From ca36b9cfeb8901b9fc1f3489b86ce271ad5ae461 Mon Sep 17 00:00:00 2001 From: pravirkr Date: Mon, 29 Apr 2024 21:48:21 +0300 Subject: [PATCH] fixed gcov version issue --- .clangd | 5 --- .cmake-format | 69 ------------------------------ codecov.yml => .github/codecov.yml | 2 +- .github/workflows/ci.yml | 11 ++--- pyproject.toml | 3 ++ 5 files changed, 8 insertions(+), 82 deletions(-) delete mode 100644 .clangd delete mode 100644 .cmake-format rename codecov.yml => .github/codecov.yml (84%) diff --git a/.clangd b/.clangd deleted file mode 100644 index 86050c7..0000000 --- a/.clangd +++ /dev/null @@ -1,5 +0,0 @@ -CompileFlags: - # Treat code as C++, use C++17 standard, enable more warnings. - Add: [-xc++, -std=c++17, -Wall, -Wno-missing-prototypes] - # Remove extra warnings specified in compile commands. - Remove: [-fopenmp=libomp] diff --git a/.cmake-format b/.cmake-format deleted file mode 100644 index 226c123..0000000 --- a/.cmake-format +++ /dev/null @@ -1,69 +0,0 @@ -format: - disable: false - line_width: 100 - tab_size: 2 - max_subgroups_hwrap: 2 - dangle_parens: true - -enable_markup: false - -parse: - additional_commands: - cpmaddpackage: - pargs: - nargs: '*' - flags: [] - spelling: CPMAddPackage - kwargs: &cpmaddpackagekwargs - NAME: 1 - FORCE: 1 - VERSION: 1 - GIT_TAG: 1 - DOWNLOAD_ONLY: 1 - GITHUB_REPOSITORY: 1 - GITLAB_REPOSITORY: 1 - GIT_REPOSITORY: 1 - SVN_REPOSITORY: 1 - SVN_REVISION: 1 - SOURCE_DIR: 1 - DOWNLOAD_COMMAND: 1 - FIND_PACKAGE_ARGUMENTS: 1 - NO_CACHE: 1 - GIT_SHALLOW: 1 - URL: 1 - URL_HASH: 1 - URL_MD5: 1 - DOWNLOAD_NAME: 1 - DOWNLOAD_NO_EXTRACT: 1 - HTTP_USERNAME: 1 - HTTP_PASSWORD: 1 - OPTIONS: + - cpmfindpackage: - pargs: - nargs: '*' - flags: [] - spelling: CPMFindPackage - kwargs: &cpmfindpackagekwargs - NAME: 1 - FORCE: 1 - VERSION: 1 - GIT_TAG: 1 - DOWNLOAD_ONLY: 1 - GITHUB_REPOSITORY: 1 - GITLAB_REPOSITORY: 1 - GIT_REPOSITORY: 1 - SVN_REPOSITORY: 1 - SVN_REVISION: 1 - SOURCE_DIR: 1 - DOWNLOAD_COMMAND: 1 - FIND_PACKAGE_ARGUMENTS: 1 - NO_CACHE: 1 - GIT_SHALLOW: 1 - URL: 1 - URL_HASH: 1 - URL_MD5: 1 - DOWNLOAD_NAME: 1 - DOWNLOAD_NO_EXTRACT: 1 - HTTP_USERNAME: 1 - HTTP_PASSWORD: 1 - OPTIONS: + diff --git a/codecov.yml b/.github/codecov.yml similarity index 84% rename from codecov.yml rename to .github/codecov.yml index c4b394f..33cdfc9 100644 --- a/codecov.yml +++ b/.github/codecov.yml @@ -3,6 +3,6 @@ coverage: status: project: default: - target: 80% + target: 50% threshold: 5% if_ci_failed: error \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc7c352..58e77ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-latest] build_type: [Debug] - compiler: [{cpp: g++-13, code-cov: true}, {cpp: clang++-15}] + compiler: [{cpp: g++-13, code-cov: true, gcov: gcov-13}, {cpp: clang++-15}] steps: - uses: actions/checkout@v4 - name: Set reusable strings @@ -31,7 +31,6 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_DOCS=OFF -DBUILD_PYTHON=OFF -DBUILD_TESTING=ON - -DUSE_CLANG_TIDY=ON -DCODE_COVERAGE=${{ matrix.compiler.code-cov }} - name: Build @@ -40,23 +39,21 @@ jobs: --config ${{ matrix.build_type }} -j 4 - name: Run unit tests - working-directory: ${{ steps.strings.outputs.build-output-dir }} run: > ctest --build-config ${{ matrix.build_type }} --output-on-failure --test-dir ${{ steps.strings.outputs.build-output-dir }}/tests/cpp - name: Prepare coverage report if: ${{ matrix.build_type == 'Debug' && matrix.compiler.code-cov }} - working-directory: ${{ steps.strings.outputs.build-output-dir }} run: | - pip install gcovr - gcovr -r .. --cobertura -o coverage.xml + pip install gcovr>=7.1 + gcovr -r . --cobertura -o coverage.xml --gcov-executable=${{ matrix.compiler.gcov }} - name: Upload coverage reports to Codecov if: ${{ matrix.build_type == 'Debug' && matrix.compiler.code-cov }} uses: codecov/codecov-action@v4 with: - file: ${{ steps.strings.outputs.build-output-dir }}/coverage.xml + file: coverage.xml name: codecov-umbrella fail_ci_if_error: true env: diff --git a/pyproject.toml b/pyproject.toml index a7b10e4..b63b73c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,9 @@ exclude_lines = ['raise AssertionError', 'raise NotImplementedError'] [tool.coverage.path] source = "src/dmt" +[tool.gcovr] +filter = ["lib/*"] + [tool.mypy] ignore_missing_imports = true plugins = ["numpy.typing.mypy_plugin"]