Skip to content

Commit a4b2dd8

Browse files
authored
Merge pull request #5 from Chisanan232/develop
🎉🎊🍾 [New Feature + Breaking Change] (config) Modify the process about organizing testing coverage reports.
2 parents 0d5c30e + b112d78 commit a4b2dd8

File tree

2 files changed

+63
-5
lines changed

2 files changed

+63
-5
lines changed

.github/workflows/organize_and_generate_testing_report.yaml renamed to .github/workflows/organize_all_testing_coverage_reports_with_different_os_and_py_version.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
############################################################################
1313

14-
name: Upload test report to Codecov
14+
name: Organize testing coverage reports as a testing coverage report
1515

1616
on:
1717
workflow_call:
@@ -52,12 +52,12 @@ jobs:
5252
- name: Report testing coverage of project code
5353
run: coverage report -m
5454

55-
- name: Generate testing report for Codacy
56-
run: coverage xml
55+
- name: Rename the testing coverage report with test type
56+
run: mv .coverage .coverage-${{ inputs.test_type }}
5757

5858
- name: Upload testing coverage report
5959
uses: actions/upload-artifact@v3
6060
with:
61-
name: project_coverage_report
62-
path: coverage.xml
61+
name: project_testing_coverage_report
62+
path: .coverage-${{ inputs.test_type }}
6363
if-no-files-found: error
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
############################################################################
2+
#
3+
# Workflow Description:
4+
# Organize all the testing coverage reports. (it would save reports by 'actions/upload-artifact@v3').
5+
#
6+
# Workflow input parameters:
7+
# No input parameters.
8+
#
9+
# Workflow running output:
10+
# No, but it would save the testing coverage reports (coverage.xml) to provide after-process to organize and record.
11+
#
12+
############################################################################
13+
14+
name: Organize all testing coverage reports, e.g., different runtime OS, as a final testing coverage report.
15+
16+
on:
17+
workflow_call:
18+
19+
20+
jobs:
21+
organize_and_generate_test_report:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
27+
- name: Download code coverage result file
28+
uses: actions/download-artifact@v3
29+
with:
30+
name: project_testing_coverage_report
31+
path: .coverage-*
32+
33+
- name: Setup Python 3.10 in Ubuntu OS
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: '3.10'
37+
38+
- name: Install Python tool 'coverage'
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -U pip
42+
pip install coverage
43+
44+
- name: Combine all code coverage result files
45+
run: coverage combine .coverage-*
46+
47+
- name: Report testing coverage of project code
48+
run: coverage report -m
49+
50+
- name: Generate testing coverage report as XML file
51+
run: coverage xml
52+
53+
- name: Upload testing coverage report
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: final_project_testing_coverage_report
57+
path: coverage.xml
58+
if-no-files-found: error

0 commit comments

Comments
 (0)