Add Code Coverage Reports (#4336)

This commit is contained in:
Glenn Jocher 2023-08-13 16:21:02 +02:00 committed by GitHub
parent 9366062af2
commit f6b58e9d75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 5 deletions

View file

@ -165,9 +165,9 @@ jobs:
run: | # CoreML must be installed before export due to protobuf error from AutoInstall
python -m pip install --upgrade pip wheel
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
pip install -e . torch==1.8.0 torchvision==0.9.0 pytest "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
pip install -e . torch==1.8.0 torchvision==0.9.0 pytest-cov "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
else
pip install -e . pytest "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
pip install -e . pytest-cov "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
fi
- name: Check environment
run: |
@ -182,7 +182,12 @@ jobs:
pip list
- name: Pytest tests
shell: bash # for Windows compatibility
run: pytest tests
run: pytest --cov=ultralytics/ --cov-report xml tests/
- name: Upload coverage reports to Codecov
if: github.repository == 'ultralytics/ultralytics' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Summary:
runs-on: ubuntu-latest