Skip to content

Commit 9d9b8cf

Browse files
committed
Upload coverage reports even if unittests fail
1 parent 2cd3bc4 commit 9d9b8cf

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/pythonpackage.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ jobs:
4343
# uses: typilus/typilus-action@v0.9
4444
- name: Install Chrome
4545
uses: browser-actions/setup-chrome@latest
46-
- name: Test with unittest
46+
continue-on-error: true
47+
with:
48+
fail_ci_if_error: false
49+
- name: Run unittests
50+
id: unittests
51+
continue-on-error: true
4752
env:
4853
CONNECTION_METHOD: ${{ secrets.CONNECTION_METHOD }}
4954
PASSWORD: ${{ secrets.PASSWORD }}
@@ -52,20 +57,23 @@ jobs:
5257
SCRAPER_API_KEY: ${{ secrets.SCRAPER_API_KEY }}
5358
run: |
5459
coverage run -m unittest -v test_module.TestScholarly
55-
coverage xml
56-
- name: Validate the repository yaml for codecov
60+
- name: Generate coverage report (macOS only)
5761
if:
58-
"matrix.os == 'ubuntu-latest'"
59-
run:
62+
"matrix.os == 'macos-latest'"
63+
run: |
6064
curl --data-binary @.github/.codecov.yml https://codecov.io/validate | head -n 1
61-
- name: Upload code coverage
65+
coverage xml
66+
- name: Upload code coverage (macOS only)
6267
if:
63-
"matrix.os != 'windows-latest'"
68+
"matrix.os == 'macos-latest'"
6469
uses: codecov/codecov-action@v2
6570
with:
6671
directory: ./
67-
fail_ci_if_error: true
72+
fail_ci_if_error: false
6873
files: ./coverage.xml
6974
flags: unittests
7075
name: codecov-umbrella
7176
verbose: true
77+
- name: Check if unittests failed
78+
if: "steps.unittests.outcome == 'failure'"
79+
run: exit 1

0 commit comments

Comments
 (0)