pipreqs/.github/workflows/codecov.yml
2023-11-08 18:46:18 -03:00

46 lines
1.5 KiB
YAML

name: CodeCov
on:
workflow_run:
workflows: [Tests]
types: [completed]
jobs:
coverage_report:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage docopt yarg requests
- name: Calculate coverage
run: coverage run --source=pipreqs -m unittest discover
- name: Create XML report
run: coverage xml
- name: Produce the coverage report
uses: insightsengineering/coverage-action@v2
with:
path: coverage.xml
# Publish the rendered output as a PR comment
publish: true
# Create a coverage diff report.
diff: true
# Branch to diff against.
diff-branch: next
# This is where the coverage reports for the
# `diff-branch` are stored.
diff-storage: _xml_coverage_reports
togglable-report: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true