|
5 | 5 | # |
6 | 6 | # Workflow input parameters: |
7 | 7 | # * 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. |
8 | 10 | # |
9 | 11 | # Workflow running output: |
10 | 12 | # No, but it would save the testing coverage reports (coverage.xml) to provide after-process to organize and record. |
|
20 | 22 | description: "The testing type. In generally, it only has 2 options: 'unit-test' and 'integration-test'." |
21 | 23 | required: true |
22 | 24 | 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 |
23 | 29 |
|
24 | 30 |
|
25 | 31 | jobs: |
@@ -52,10 +58,24 @@ jobs: |
52 | 58 | - name: Report testing coverage of project code |
53 | 59 | run: coverage report -m |
54 | 60 |
|
| 61 | + - name: General testing coverage report as XML format |
| 62 | + if: ${{ inputs.generate_xml_report_finally }} == 'true' |
| 63 | + run: coverage xml |
| 64 | + |
55 | 65 | - name: Rename the testing coverage report with test type |
| 66 | + if: ${{ inputs.generate_xml_report_finally }} == 'false' |
56 | 67 | run: mv .coverage .coverage-${{ inputs.test_type }} |
57 | 68 |
|
58 | 69 | - 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' |
59 | 79 | uses: actions/upload-artifact@v3 |
60 | 80 | with: |
61 | 81 | name: project_testing_coverage_report |
|
0 commit comments