Skip to content

Commit 10479b4

Browse files
committed
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.
1 parent 02c266b commit 10479b4

File tree

3 files changed

+10
-38
lines changed

3 files changed

+10
-38
lines changed

.github/workflows/generate_coverage.yaml

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ jobs:
5757
intel-oneapi-libdpstd-devel \
5858
intel-oneapi-compiler-dpcpp-cpp
5959
60-
- name: Install Lcov
61-
run: |
62-
sudo apt-get install lcov
63-
sudo gem install coveralls-lcov
64-
6560
- name: Checkout repo
6661
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6762
with:
@@ -142,32 +137,6 @@ jobs:
142137
echo "Total number of coverage attempts: ${{ steps.build_coverage.outputs.total_attempts }}"
143138
144139
- name: Upload coverage data to coveralls.io
145-
run: |
146-
echo "Processing pytest-coverage"
147-
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov)
148-
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json
149-
150-
# merge file with coverage data and upload
151-
echo "Merging files with coverage data"
152-
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json
153-
env:
154-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155-
COVERALLS_PARALLEL: true
156-
157-
coveralls:
158-
name: Indicate completion to coveralls.io
159-
160-
needs: generate-coverage
161-
162-
runs-on: ubuntu-latest
163-
timeout-minutes: 10
164-
165-
container: python:3-slim
166-
167-
steps:
168-
- name: Finished
169-
run: |
170-
pip3 install --upgrade coveralls==3.3.1
171-
coveralls --service=github --finish
172-
env:
173-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
141+
with:
142+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ __pycache__/
1111
.vscode
1212

1313
# Files from test of code coverage
14-
coverage.xml
14+
.coverage
15+
*.lcov
16+
dpnp/**/*.cxx
17+
dpnp_pytest.*
1518

1619
# Backup files kept after git merge/rebase
1720
*.orig

scripts/gen_coverage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def run(
6767
"pyproject.toml",
6868
"--cov",
6969
"dpnp",
70-
"--cov-report",
71-
"term-missing",
70+
"--cov-report=term-missing",
71+
"--cov-report=lcov:coverage-python.lcov",
7272
"--pyargs",
7373
"dpnp",
7474
"-vv",
@@ -110,7 +110,7 @@ def find_objects():
110110
)
111111

112112
# export lcov
113-
with open("dpnp_pytest.lcov", "w") as fh:
113+
with open("coverage-cpp.lcov", "w") as fh:
114114
subprocess.check_call(
115115
[
116116
os.path.join(bin_llvm, "llvm-cov"),

0 commit comments

Comments
 (0)