Skip to content

Commit 8b11ace

Browse files
committed
[Test] (code) Add testing code for testing of codecov.
1 parent 75a0fc0 commit 8b11ace

File tree

1 file changed

+39
-46
lines changed

1 file changed

+39
-46
lines changed

.github/workflows/upload_test_cov_report.yaml

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ jobs:
101101
echo "Check the parameters of uploading report to Codacy ..."
102102
bash ./scripts/ci/check-input-params.sh ${{ inputs.upload-to-codacy }} ${{ secrets.codacy_token }}
103103
104-
# TODO: It's possible be better that open input parameter 'file_path' or 'download name' outside.
105104
- name: Download code coverage result files which has be handled by different test type process
106105
uses: actions/download-artifact@v3
107106
with:
108107
name: test_coverage_data_file
109108
path: ${{ inputs.download_path }}
110109

111-
# TODO: It's possible be better that open input parameter 'file_path' or 'download name' outside.
112110
- name: Download code coverage result files which has be handled by different test type process
113111
uses: actions/download-artifact@v3
114112
with:
@@ -131,63 +129,58 @@ jobs:
131129
if: ${{ inputs.upload-to-codecov == true }}
132130
run: pip3 install codecov
133131

132+
- name: Upload coverage report to Codecov https://codecov.io (For Unit-Test or Integration-Test)
133+
if: ${{ inputs.upload-to-codecov == true && (inputs.test_type == 'unit-test' || inputs.test_type == 'integration-test') }}
134+
run: |
135+
codecov \
136+
-t ${{ secrets.codecov_token }} \
137+
--file coverage_${{ inputs.test_type }}_${{ inputs.test_os }}.xml \
138+
--flags ${{ inputs.codecov_flags }} \
139+
--env OS,PYTHON \
140+
--name ${{ inputs.codecov_name }} \
141+
--required \
142+
--verbose
143+
144+
- name: Upload coverage report to Codecov https://codecov.io (For all test types)
145+
if: ${{ inputs.upload-to-codecov == true && inputs.test_type == 'all-test' }}
146+
run: |
147+
codecov \
148+
-t ${{ secrets.codecov_token }} \
149+
--file coverage.xml \
150+
--flags ${{ inputs.codecov_flags }} \
151+
--env OS,PYTHON \
152+
--name ${{ inputs.codecov_name }} \
153+
--required \
154+
--verbose
155+
134156
# - name: Upload coverage report to Codecov https://codecov.io (For Unit-Test or Integration-Test)
135157
# if: ${{ inputs.upload-to-codecov == true && (inputs.test_type == 'unit-test' || inputs.test_type == 'integration-test') }}
136-
# run: |
137-
# codecov \
138-
# -t ${{ secrets.codecov_token }} \
139-
# --file coverage_${{ inputs.test_type }}_${{ inputs.test_os }}.xml \
140-
# --flags ${{ inputs.codecov_flags }} \
141-
# --env OS,PYTHON \
142-
# --name ${{ inputs.codecov_name }} \
143-
# --required \
144-
# --verbose
158+
# uses: codecov/codecov-action@v3
159+
# with:
160+
# token: ${{ secrets.codecov_token }} # not required for public repos
161+
# files: coverage_${{ inputs.test_type }}_${{ inputs.test_os }}.xml # optional
162+
# fail_ci_if_error: true # optional (default = false)
163+
# verbose: true # optional (default = false)
164+
## flags: ${{ inputs.codecov_flags }} # optional
165+
## env_vars: OS,PYTHON
166+
## name: ${{ inputs.codecov_name }} # optional
145167
#
146168
# - name: Upload coverage report to Codecov https://codecov.io (For all test types)
147169
# if: ${{ inputs.upload-to-codecov == true && inputs.test_type == 'all-test' }}
148-
# run: |
149-
# codecov \
150-
# -t ${{ secrets.codecov_token }} \
151-
# --file coverage.xml \
152-
# --flags ${{ inputs.codecov_flags }} \
153-
# --env OS,PYTHON \
154-
# --name ${{ inputs.codecov_name }} \
155-
# --required \
156-
# --verbose
157-
158-
- name: Upload coverage report to Codecov https://codecov.io (For Unit-Test or Integration-Test)
159-
if: ${{ inputs.upload-to-codecov == true && (inputs.test_type == 'unit-test' || inputs.test_type == 'integration-test') }}
160-
uses: codecov/codecov-action@v3
161-
with:
162-
token: ${{ secrets.codecov_token }} # not required for public repos
163-
files: coverage_${{ inputs.test_type }}_${{ inputs.test_os }}.xml # optional
164-
fail_ci_if_error: true # optional (default = false)
165-
verbose: true # optional (default = false)
170+
# uses: codecov/codecov-action@v3
171+
# with:
172+
# token: ${{ secrets.codecov_token }} # not required for public repos
173+
# files: coverage.xml # optional
166174
# flags: ${{ inputs.codecov_flags }} # optional
167175
# env_vars: OS,PYTHON
168176
# name: ${{ inputs.codecov_name }} # optional
169-
170-
- name: Upload coverage report to Codecov https://codecov.io (For all test types)
171-
if: ${{ inputs.upload-to-codecov == true && inputs.test_type == 'all-test' }}
172-
uses: codecov/codecov-action@v3
173-
with:
174-
token: ${{ secrets.codecov_token }} # not required for public repos
175-
files: coverage.xml # optional
176-
flags: ${{ inputs.codecov_flags }} # optional
177-
env_vars: OS,PYTHON
178-
name: ${{ inputs.codecov_name }} # optional
179-
fail_ci_if_error: true # optional (default = false)
180-
verbose: true # optional (default = false)
177+
# fail_ci_if_error: true # optional (default = false)
178+
# verbose: true # optional (default = false)
181179

182180
- name: Install Python dependencies about tool of Coveralls
183181
if: ${{ inputs.upload-to-coveralls == true }}
184182
run: |
185183
pip3 install coveralls
186-
# pip3 install coverage
187-
188-
# - name: Combine all testing code coverage result files with all test types
189-
# if: ${{ inputs.upload-to-coveralls == true }}
190-
# run: coverage combine .coverage.*
191184
192185
- name: Upload coverage report to Coveralls https://coveralls.io
193186
if: ${{ inputs.upload-to-coveralls == true }}

0 commit comments

Comments
 (0)