mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Fixed publishing code coverage results.
This commit is contained in:
17
.github/workflows/CompletePipeline.yml
vendored
17
.github/workflows/CompletePipeline.yml
vendored
@@ -102,6 +102,9 @@ on:
|
||||
PYPI_TOKEN:
|
||||
description: "Token for pushing releases to PyPI."
|
||||
required: false
|
||||
CODECOV_TOKEN:
|
||||
description: "Token for pushing coverage and unittest results to Codecov."
|
||||
required: false
|
||||
CODACY_PROJECT_TOKEN:
|
||||
description: "Token for pushing coverage results to Codacy."
|
||||
required: false
|
||||
@@ -132,10 +135,10 @@ jobs:
|
||||
package_name: ${{ inputs.package_name }}
|
||||
python_version: ${{ inputs.apptest_python_version }}
|
||||
python_version_list: ${{ inputs.apptest_python_version_list }}
|
||||
system_list: ${{ inputs.apptest_system_list }}
|
||||
include_list: ${{ inputs.apptest_include_list }}
|
||||
exclude_list: ${{ inputs.apptest_exclude_list }}
|
||||
disable_list: ${{ inputs.apptest_disable_list }}
|
||||
system_list: ${{ inputs.apptest_system_list }}
|
||||
include_list: ${{ inputs.apptest_include_list }}
|
||||
exclude_list: ${{ inputs.apptest_exclude_list }}
|
||||
disable_list: ${{ inputs.apptest_disable_list }}
|
||||
|
||||
UnitTesting:
|
||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
|
||||
@@ -211,9 +214,9 @@ jobs:
|
||||
coverage_report_json_filename: ${{ needs.ConfigParams.outputs.coverage_report_json_filename }}
|
||||
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
||||
coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }}
|
||||
|
||||
secrets:
|
||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
CODACY_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
|
||||
PublishTestResults:
|
||||
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev
|
||||
@@ -225,6 +228,8 @@ jobs:
|
||||
additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"'
|
||||
merged_junit_filename: ${{ needs.ConfigParams.outputs.unittest_merged_report_xml_filename }}
|
||||
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
# VerifyDocs:
|
||||
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev
|
||||
|
||||
28
.github/workflows/PublishCoverageResults.yml
vendored
28
.github/workflows/PublishCoverageResults.yml
vendored
@@ -83,9 +83,22 @@ on:
|
||||
required: false
|
||||
default: 'report/coverage/html'
|
||||
type: string
|
||||
codecov:
|
||||
description: 'Publish merged coverage report to Codecov.'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
codacy:
|
||||
description: 'Publish merged coverage report to Codacy.'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
secrets:
|
||||
codacy_token:
|
||||
description: 'Token to push result to codacy.'
|
||||
CODECOV_TOKEN:
|
||||
description: 'Token to push result to Codecov.'
|
||||
required: true
|
||||
CODACY_TOKEN:
|
||||
description: 'Token to push result to Codacy.'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
@@ -128,7 +141,7 @@ jobs:
|
||||
run: coverage report --rcfile=pyproject.toml --data-file=.coverage
|
||||
|
||||
- name: Convert to XML format (Cobertura)
|
||||
if: inputs.coverage_xml_artifact != ''
|
||||
if: inputs.coverage_xml_artifact != '' || inputs.codecov || inputs.codacy
|
||||
run: coverage xml --data-file=.coverage
|
||||
|
||||
- name: Convert to JSON format
|
||||
@@ -187,17 +200,20 @@ jobs:
|
||||
|
||||
- name: 📊 Publish code coverage at CodeCov
|
||||
uses: codecov/codecov-action@v5
|
||||
if: inputs.CodeCov == true
|
||||
if: inputs.codecov
|
||||
continue-on-error: true
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
disable_search: true
|
||||
files: ${{ inputs.coverage_report_xml_directory }}/${{ inputs.coverage_report_xml_filename }}
|
||||
flags: unittests
|
||||
env_vars: PYTHON
|
||||
fail_ci_if_error: true
|
||||
|
||||
- name: 📉 Publish code coverage at Codacy
|
||||
uses: codacy/codacy-coverage-reporter-action@v1
|
||||
if: inputs.Codacy == true
|
||||
if: inputs.codacy
|
||||
continue-on-error: true
|
||||
with:
|
||||
project-token: ${{ secrets.codacy_token }}
|
||||
project-token: ${{ secrets.CODACY_TOKEN }}
|
||||
coverage-reports: ${{ inputs.coverage_report_xml_directory }}/${{ inputs.coverage_report_xml_filename }}
|
||||
|
||||
19
.github/workflows/PublishTestResults.yml
vendored
19
.github/workflows/PublishTestResults.yml
vendored
@@ -59,6 +59,15 @@ on:
|
||||
required: false
|
||||
default: 'Unit Test Results'
|
||||
type: string
|
||||
codecov:
|
||||
description: 'Publish merged unittest results to Codecov.'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
secrets:
|
||||
CODECOV_TOKEN:
|
||||
description: 'Token to push result to Codecov.'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
PublishTestResults:
|
||||
@@ -104,6 +113,16 @@ jobs:
|
||||
path: ${{ inputs.merged_junit_filename }}
|
||||
reporter: java-junit
|
||||
|
||||
- name: 📊 Publish unittest results at CodeCov
|
||||
uses: codecov/test-results-action@v1
|
||||
if: inputs.codecov
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
disable_search: true
|
||||
files: ${{ inputs.merged_junit_filename }}
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
|
||||
- name: 📤 Upload merged 'JUnit Test Summary' artifact
|
||||
uses: pyTooling/upload-artifact@v4
|
||||
if: inputs.merged_junit_artifact != ''
|
||||
|
||||
14
.github/workflows/_Checking_JobTemplates.yml
vendored
14
.github/workflows/_Checking_JobTemplates.yml
vendored
@@ -96,14 +96,20 @@ jobs:
|
||||
PublishCoverageResults:
|
||||
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev
|
||||
needs:
|
||||
- ConfigParams
|
||||
- UnitTestingParams
|
||||
- UnitTesting
|
||||
- PlatformTesting
|
||||
with:
|
||||
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
||||
coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
||||
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
||||
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
||||
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
||||
coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
||||
coverage_report_xml_directory: ${{ needs.ConfigParams.outputs.coverage_report_xml_directory }}
|
||||
coverage_report_xml_filename: ${{ needs.ConfigParams.outputs.coverage_report_xml_filename }}
|
||||
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
||||
coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }}
|
||||
coverage_report_json_filename: ${{ needs.ConfigParams.outputs.coverage_report_json_filename }}
|
||||
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
||||
coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }}
|
||||
secrets:
|
||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ jobs:
|
||||
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@dev
|
||||
with:
|
||||
package_name: pyDummy
|
||||
cleanup: false
|
||||
secrets:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-r ../requirements.txt
|
||||
|
||||
pyTooling ~= 8.3
|
||||
pyTooling ~= 8.4
|
||||
|
||||
# Enforce latest version on ReadTheDocs
|
||||
sphinx ~= 8.2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
requires = [
|
||||
"setuptools ~= 78.1",
|
||||
"wheel ~= 0.45",
|
||||
"pyTooling ~= 8.3"
|
||||
"pyTooling ~= 8.4"
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
pyTooling ~= 8.3
|
||||
pyTooling ~= 8.4
|
||||
|
||||
Reference in New Issue
Block a user