Skip to content

Commit

Permalink
⚖️ Add coverage (#499)
Browse files Browse the repository at this point in the history
* Add coverage report upload to pre_merge

* Use python uploader

* Explicitly pass commit hash

* Get ref from expression

* Fix typo

* Debug

* Revert

* Debug

* Debug

* Debug

* Debug

* Use variable for commit id

* Add coverage badge

* Add comments
  • Loading branch information
ashwinvaidya17 committed Aug 12, 2022
1 parent a67f625 commit bc788dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/pre_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ jobs:
export ANOMALIB_DATASET_PATH=/media/data1/datasets/
export CUDA_VISIBLE_DEVICES=3
tox -e pre_merge
- name: Upload coverage result
uses: actions/upload-artifact@v2
with:
name: coverage
path: .tox/coverage.xml
- name: Upload coverage report
run: |
# If the workflow is triggered from PR then it gets the commit id from the PR.
# else it uses the commit id of the latest commit. This is because the commit
# of the checked-out branch/commit does not exist in the tree as it is grafted.
if [[ ${{ github.event.pull_request.head.sha }} ]]
then
COMMIT_ID=${{ github.event.pull_request.head.sha }}
else
COMMIT_ID=${{ github.sha }}
fi
pip install codacy-coverage
python-codacy-coverage -r .tox/coverage.xml -t ${{ secrets.CODACY }} -c $COMMIT_ID
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)]()
[![Nightly-Regression Test](https://github.com/openvinotoolkit/anomalib/actions/workflows/nightly.yml/badge.svg)](https://github.com/openvinotoolkit/anomalib/actions/workflows/nightly.yml)
[![Pre-Merge Checks](https://github.com/openvinotoolkit/anomalib/actions/workflows/pre_merge.yml/badge.svg)](https://github.com/openvinotoolkit/anomalib/actions/workflows/pre_merge.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/684927c1c76c4c5e94bb53480812fbbb)](https://www.codacy.com/gh/openvinotoolkit/anomalib/dashboard?utm_source=github.com&utm_medium=referral&utm_content=openvinotoolkit/anomalib&utm_campaign=Badge_Coverage)
[![Docs](https://github.com/openvinotoolkit/anomalib/actions/workflows/docs.yml/badge.svg)](https://github.com/openvinotoolkit/anomalib/actions/workflows/docs.yml)
[![Downloads](https://static.pepy.tech/personalized-badge/anomalib?period=total&units=international_system&left_color=grey&right_color=green&left_text=PyPI%20Downloads)](https://pepy.tech/project/anomalib)

Expand Down

0 comments on commit bc788dd

Please sign in to comment.