Skip to content

Commit a97587b

Browse files
committed
[Breaking Change] (config) Add a new input parameter and modify steps.
1 parent b112d78 commit a97587b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/organize_all_testing_coverage_reports_with_different_os_and_py_version.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#
66
# Workflow input parameters:
77
# * test_type: The testing type. In generally, it only has 2 options: 'unit-test' and 'integration-test'.
8+
# * generate_xml_report_finally: Something, it only has 1 test type currently. So it could let this option
9+
# to be 'true' than it would generate XML report finally to let uploading process to use it directly.
810
#
911
# Workflow running output:
1012
# No, but it would save the testing coverage reports (coverage.xml) to provide after-process to organize and record.
@@ -20,6 +22,10 @@ on:
2022
description: "The testing type. In generally, it only has 2 options: 'unit-test' and 'integration-test'."
2123
required: true
2224
type: string
25+
generate_xml_report_finally:
26+
description: "Something, it only has 1 test type currently. So it could let this option to be 'true' than it would generate XML report finally to let uploading process to use it directly."
27+
required: true
28+
type: boolean
2329

2430

2531
jobs:
@@ -52,10 +58,24 @@ jobs:
5258
- name: Report testing coverage of project code
5359
run: coverage report -m
5460

61+
- name: General testing coverage report as XML format
62+
if: ${{ inputs.generate_xml_report_finally }} == 'true'
63+
run: coverage xml
64+
5565
- name: Rename the testing coverage report with test type
66+
if: ${{ inputs.generate_xml_report_finally }} == 'false'
5667
run: mv .coverage .coverage-${{ inputs.test_type }}
5768

5869
- name: Upload testing coverage report
70+
if: ${{ inputs.generate_xml_report_finally }} == 'true'
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: final_project_testing_coverage_report
74+
path: coverage.xml
75+
if-no-files-found: error
76+
77+
- name: Upload testing coverage report
78+
if: ${{ inputs.generate_xml_report_finally }} == 'false'
5979
uses: actions/upload-artifact@v3
6080
with:
6181
name: project_testing_coverage_report

0 commit comments

Comments
 (0)