From 10479b45f30483d0b69e9b49bb30bdcc197eabc4 Mon Sep 17 00:00:00 2001 From: Anton <100830759+antonwolfy@users.noreply.github.com> Date: Tue, 4 Nov 2025 13:19:02 +0100 Subject: [PATCH] Use GitHub action to upload the coverage data to `coveralls.io` (#2644) The PR replaces the old implementation through manual submitting `.json` file to `coveralls.io` with `coverallsapp/github-action` step which does everything automatically. --- .github/workflows/generate_coverage.yaml | 37 ++---------------------- .gitignore | 5 +++- scripts/gen_coverage.py | 6 ++-- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/.github/workflows/generate_coverage.yaml b/.github/workflows/generate_coverage.yaml index 10ea34c21806..75612548377b 100644 --- a/.github/workflows/generate_coverage.yaml +++ b/.github/workflows/generate_coverage.yaml @@ -57,11 +57,6 @@ jobs: intel-oneapi-libdpstd-devel \ intel-oneapi-compiler-dpcpp-cpp - - name: Install Lcov - run: | - sudo apt-get install lcov - sudo gem install coveralls-lcov - - name: Checkout repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -142,32 +137,6 @@ jobs: echo "Total number of coverage attempts: ${{ steps.build_coverage.outputs.total_attempts }}" - name: Upload coverage data to coveralls.io - run: | - echo "Processing pytest-coverage" - export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov) - coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json - - # merge file with coverage data and upload - echo "Merging files with coverage data" - coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true - - coveralls: - name: Indicate completion to coveralls.io - - needs: generate-coverage - - runs-on: ubuntu-latest - timeout-minutes: 10 - - container: python:3-slim - - steps: - - name: Finished - run: | - pip3 install --upgrade coveralls==3.3.1 - coveralls --service=github --finish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index c263dae47818..39834a56fde2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,10 @@ __pycache__/ .vscode # Files from test of code coverage -coverage.xml +.coverage +*.lcov +dpnp/**/*.cxx +dpnp_pytest.* # Backup files kept after git merge/rebase *.orig diff --git a/scripts/gen_coverage.py b/scripts/gen_coverage.py index 89f3f0ce30f6..c3e95352a4ae 100644 --- a/scripts/gen_coverage.py +++ b/scripts/gen_coverage.py @@ -67,8 +67,8 @@ def run( "pyproject.toml", "--cov", "dpnp", - "--cov-report", - "term-missing", + "--cov-report=term-missing", + "--cov-report=lcov:coverage-python.lcov", "--pyargs", "dpnp", "-vv", @@ -110,7 +110,7 @@ def find_objects(): ) # export lcov - with open("dpnp_pytest.lcov", "w") as fh: + with open("coverage-cpp.lcov", "w") as fh: subprocess.check_call( [ os.path.join(bin_llvm, "llvm-cov"),