Skip to content

Commit 4b1734f

Browse files
Dídac Colldidix21
authored andcommitted
Update codecov github action and add analytics
- fix tests
1 parent 1c4ed70 commit 4b1734f

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ jobs:
2020
python-version: '3.10'
2121
- name: Install dependencies
2222
run: |
23-
pip install coverage
24-
pip install -U pytest
23+
pip install pytest
24+
pip install pytest-cov
2525
- name: Test unittest
2626
run: |
27-
coverage run -m pytest
28-
coverage xml
27+
pytest --cov --junitxml=junit.xml -o junit_family=legacy
28+
- name: Upload test results to Codecov
29+
if: ${{ !cancelled() }}
30+
uses: codecov/test-results-action@v1
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
2933
- name: "Upload coverage to Codecov"
30-
uses: codecov/codecov-action@v2
34+
uses: codecov/codecov-action@v5
3135
with:
3236
fail_ci_if_error: true
3337
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/prepare-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
python -m pip install --upgrade pip
2727
pip install twine
2828
pip install coverage
29-
pip install -U pytest
29+
pip install pytest
30+
pip install pytest-cov
3031
pip install poetry
3132
3233
- name: Run unit tests
3334
run: |
34-
coverage run -m pytest
35-
coverage xml
35+
pytest --cov --junitxml=junit.xml -o junit_family=legacy
3636
3737
- name: Bump version on all needed files
3838
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ coverage.xml
140140
*.cover
141141
.hypothesis/
142142
.pytest_cache/
143+
junit.xml
143144

144145
# Translations
145146
*.mo

tests/test_fileutils/__init__.py

Whitespace-only changes.

tests/test_fileutils/test_fileutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# MIT License: (C) 2020 Dídac Coll
88

99
from unittest import TestCase
10-
from mdutils.fileutils import MarkDownFile
10+
from mdutils.fileutils.fileutils import MarkDownFile
1111
import tempfile
1212

1313

0 commit comments

Comments
 (0)