diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 409a2871..204c13fe 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -61,17 +61,24 @@ jobs: -p no:sugar \ tests/components/adaptive_lighting - - name: Run Tests with Coverage - run: | - cd core - pytest --cov=homeassistant --cov-report=html tests/components/adaptive_lighting + - name: ReportGenerator + uses: danielpalme/ReportGenerator-GitHub-Action@5.1.19 + with: + reports: 'core/coverage.xml' + targetdir: 'coveragereport' + reporttypes: 'HtmlInline;Cobertura' + assemblyfilters: '+*' + classfilters: '+*' + filefilters: '+*' + verbosity: 'Info' + tag: '${{ github.run_number }}_${{ github.run_id }}' - name: Push Coverage Report to Branch run: | git config user.name "GitHub Actions" git config user.email "actions@users.noreply.github.com" git checkout -B coverage-report - mv core/htmlcov coverage-report + mv coveragereport coverage-report git add coverage-report git commit -m "Update coverage report" git push -f origin coverage-report diff --git a/Dockerfile b/Dockerfile index 45522da8..5358cc78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ ENTRYPOINT ["python3", \ # Print the 10 slowest tests "--durations=10", \ # Measure code coverage for the 'homeassistant' package - "--cov='homeassistant'", \ + "--cov='homeassistant/components/adaptive_lighting'", \ # Generate an XML report of the code coverage "--cov-report=xml", \ # Generate an HTML report of the code coverage