Skip to content

Commit 201085a

Browse files
authored
add coverage to workflows (#93)
* add coverage to workflows * adapt licenses * exclude proto files from coverage
1 parent f32b017 commit 201085a

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
- name: Initialize python
4545
uses: actions/setup-python@v4
4646
with:
47-
python-version: ${{ matrix.python-version }}
48-
cache: "pip"
49-
cache-dependency-path: |
50-
**/requirements*.txt
47+
python-version: ${{ matrix.python-version }}
48+
cache: "pip"
49+
cache-dependency-path: |
50+
**/requirements*.txt
5151
5252
- name: Install Dependencies
5353
run: |
@@ -69,6 +69,29 @@ jobs:
6969
- name: Run unit and integration tests
7070
run: tox
7171

72+
- name: Publish Unit Test Results
73+
uses: mikepenz/action-junit-report@v3
74+
if: always()
75+
with:
76+
report_paths: ./results/UnitTest/junit.xml
77+
summary: true
78+
update_check: true
79+
annotate_only: true
80+
81+
- name: ReportGenerator
82+
uses: danielpalme/[email protected]
83+
with:
84+
reports: "./results/CodeCoverage/cobertura-coverage.xml" # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
85+
targetdir: "." # REQUIRED # The directory where the generated report should be saved.
86+
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
87+
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.
88+
verbosity: "Info" # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
89+
title: "Coverage" # Optional title.
90+
tag: "${{ github.run_number }}_${{ github.run_id }}" # Optional tag or build version.
91+
92+
- run: |
93+
cat SummaryGithub.md >> $GITHUB_STEP_SUMMARY
94+
7295
- name: Test setup.cfg execution
7396
run: |
7497
python3 setup.py sdist

NOTICE-3RD-PARTY-CONTENT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
|paho-mqtt|1.6.1|OSI Approved|
5656
|pathspec|0.11.1|Mozilla Public License 2.0 (MPL 2.0)|
5757
|pbr|5.11.1|Apache 2.0|
58-
|pip|23.1.2|MIT|
58+
|pip|23.2.1|MIT|
5959
|pip-tools|6.12.3|BSD|
6060
|platformdirs|3.2.0|MIT|
6161
|pluggy|1.0.0|MIT|
@@ -99,5 +99,7 @@
9999
|actions/setup-java|v1.4.4|MIT License|
100100
|actions/setup-python|v4|MIT License|
101101
|actions/upload-artifact|v3|MIT License|
102+
|danielpalme/ReportGenerator-GitHub-Action|5.1.23|Apache License 2.0|
102103
|github/codeql-action|v2|MIT License|
104+
|mikepenz/action-junit-report|v3|Apache License 2.0|
103105
|softprops/action-gh-release|v1|MIT License|

tox.ini

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ python =
1515
[testenv]
1616
deps = -rrequirements.txt
1717
commands =
18-
pytest
19-
18+
pytest --override-ini junit_family=xunit1 --junit-xml=./results/UnitTest/junit.xml \
19+
--cov ./sdv \
20+
--cov-report=xml:results/CodeCoverage/cobertura-coverage.xml \
21+
--cov-branch ./tests
2022
[testenv:type]
2123
basepython = python3
2224
usedevelop = False
@@ -25,3 +27,7 @@ commands =
2527
mypy --config-file setup.cfg sdv
2628
commands_pre =
2729
pip3 install -e {toxinidir}/
30+
31+
[coverage:run]
32+
omit =
33+
sdv/proto/*

0 commit comments

Comments
 (0)