Skip to content

Commit

Permalink
add coverage to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MP91 committed Jul 31, 2023
1 parent f32b017 commit 832237c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
- name: Initialize python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
**/requirements*.txt
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
Expand All @@ -69,6 +69,29 @@ jobs:
- name: Run unit and integration tests
run: tox

- name: Publish Unit Test Results
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: ./results/UnitTest/junit.xml
summary: true
update_check: true
annotate_only: true

- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.23
with:
reports: "./results/CodeCoverage/cobertura-coverage.xml" # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: "." # REQUIRED # The directory where the generated report should be saved.
reporttypes: "MarkdownSummaryGithub" # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, OpenCover, CsvSummary, Html, Html_Dark, Html_Light, Html_BlueRed, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary
sourcedirs: "./sdv" # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
verbosity: "Info" # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
title: "Coverage" # Optional title.
tag: "${{ github.run_number }}_${{ github.run_id }}" # Optional tag or build version.

- run: |
cat SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Test setup.cfg execution
run: |
python3 setup.py sdist
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ python =
[testenv]
deps = -rrequirements.txt
commands =
pytest

pytest --override-ini junit_family=xunit1 --junit-xml=./results/UnitTest/junit.xml \
--cov ./sdv \
--cov-report=xml:results/CodeCoverage/cobertura-coverage.xml \
--cov-branch ./tests
[testenv:type]
basepython = python3
usedevelop = False
Expand Down

0 comments on commit 832237c

Please sign in to comment.