Skip to content

Commit

Permalink
Upload coverage to Codecov (AdrienWehrle#63)
Browse files Browse the repository at this point in the history
* setup codecov

* setup codecov

* setup codecov in conda environment

* setup codecov in conda environment

* setup codecov in conda environment

* setup codecov in conda environment

* setup codecov in conda environment
  • Loading branch information
AdrienWehrle authored Aug 14, 2022
1 parent 8c2dea8 commit dd52237
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,26 @@ jobs:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
- name: Run tests and generate coverage report
shell: bash -l {0}
run: |
pip install pytest
pytest .
pip install pytest-cov
pytest --cov=./ --cov-report=xml
env:
SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }}
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./coverage/reports/
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
verbose: true

- name: Safety check
uses: AlicanAkkus/[email protected]

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,9 @@ auth.txt
# emacs backup files
*~
\#*\#

# codecov
*.gcno
*.gcda
*.gcov
test_calculator

0 comments on commit dd52237

Please sign in to comment.