|
45 | 45 | needs: check_cov_skip |
46 | 46 | if: needs.check_cov_skip.outputs.can-skip != 'true' |
47 | 47 | outputs: |
48 | | - diff_cov_file_url: ${{ steps.cov_upload.outputs.diff_cov_file_url }} |
| 48 | + all_cov_file_url: ${{ steps.cov_upload.outputs.all_cov_file_url }} |
49 | 49 | unittest_failed_url: ${{ steps.cov_upload.outputs.unittest_failed_url }} |
50 | 50 | diff_cov_result_json_url: ${{ steps.cov_upload.outputs.diff_cov_result_json_url }} |
51 | 51 | steps: |
@@ -174,7 +174,7 @@ jobs: |
174 | 174 | git config --global --add safe.directory /workspace/FastDeploy |
175 | 175 | cd FastDeploy |
176 | 176 | git diff origin/${BASE_REF}..HEAD --unified=0 > diff.txt |
177 | | - python -m pip install paddlepaddle-gpu==3.3.0.dev20251118 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/ |
| 177 | + python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/ |
178 | 178 | pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple |
179 | 179 |
|
180 | 180 | python -m pip install -r scripts/unittest_requirement.txt |
@@ -202,7 +202,7 @@ jobs: |
202 | 202 | if [[ "$IS_PR" == "true" ]]; then |
203 | 203 | echo "Running diff coverage for PR..." |
204 | 204 | diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9 |
205 | | - python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml |
| 205 | + # python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml |
206 | 206 | else |
207 | 207 | echo "Running full coverage" |
208 | 208 | coverage report -m > full_coverage_report.txt |
@@ -250,15 +250,15 @@ jobs: |
250 | 250 |
|
251 | 251 | target_path_stripped="${target_path#paddle-github-action/}" |
252 | 252 |
|
253 | | - if [[ "$IS_PR" == "true" ]]; then |
254 | | - diff_cov_file="diff_coverage.xml" |
255 | | - if [ -f ${diff_cov_file} ]; then |
256 | | - python ${push_file} ${diff_cov_file} ${target_path}/CoverageData |
257 | | - DIFF_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${diff_cov_file} |
258 | | - echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_OUTPUT |
259 | | - echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_ENV |
260 | | - fi |
| 253 | + all_coverage_file="python_coverage_all.xml" |
| 254 | + if [ -f ${all_coverage_file} ]; then |
| 255 | + python ${push_file} ${all_coverage_file} ${target_path}/CoverageData |
| 256 | + ALL_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${all_coverage_file} |
| 257 | + echo "all_cov_file_url=${ALL_COV_FILE_URL}" >> $GITHUB_OUTPUT |
| 258 | + echo "all_cov_file_url=${ALL_COV_FILE_URL}" >> $GITHUB_ENV |
| 259 | + fi |
261 | 260 |
|
| 261 | + if [[ "$IS_PR" == "true" ]]; then |
262 | 262 | diff_cov_result_json="diff_coverage.json" |
263 | 263 | if [ -f ${diff_cov_result_json} ]; then |
264 | 264 | python ${push_file} ${diff_cov_result_json} ${target_path}/CoverageData |
@@ -352,28 +352,33 @@ jobs: |
352 | 352 | runs-on: ubuntu-latest |
353 | 353 | timeout-minutes: 15 |
354 | 354 | env: |
355 | | - fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }} |
| 355 | + all_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.all_cov_file_url }} |
356 | 356 | steps: |
357 | | - - name: coverage diff file download |
| 357 | + - name: Clone FastDeploy |
| 358 | + uses: actions/checkout@v4 |
| 359 | + with: |
| 360 | + fetch-depth: 0 |
| 361 | + - uses: actions/setup-python@v5 |
| 362 | + with: |
| 363 | + python-version: '3.10' |
| 364 | + - name: Download diff coverage file |
358 | 365 | shell: bash |
359 | | - env: |
360 | | - diff_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url }} |
361 | 366 | run: | |
362 | | - wget -q --no-proxy ${fd_archive_url} |
363 | | - tar -xf FastDeploy.tar.gz |
364 | | - cd FastDeploy |
365 | | - if [ -z "${diff_cov_file_url}" ]; then |
366 | | - echo "No diff coverage file URL provided." |
| 367 | + echo "Downloading all coverage file..." |
| 368 | + if ! wget --no-proxy "${all_cov_file_url}" -O python_coverage_all.xml; then |
| 369 | + echo "Download failed, skipping upload." |
367 | 370 | exit 0 |
368 | 371 | fi |
369 | | - wget "${diff_cov_file_url}" -O ./diff_coverage.xml || echo "Download cov file failed, but continuing..." |
| 372 | +
|
| 373 | + sed -i 's|<source>/workspace/FastDeploy/fastdeploy</source>|<source>fastdeploy</source>|' python_coverage_all.xml |
| 374 | +
|
370 | 375 | - name: Upload diff coverage report |
371 | | - if: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url != null && needs.run_tests_with_coverage.outputs.diff_cov_file_url != '' }} |
372 | | - uses: codecov/codecov-action@v5 |
| 376 | + if: always() && hashFiles('python_coverage_all.xml') != '' |
| 377 | + uses: codecov/codecov-action@v4 |
373 | 378 | with: |
374 | | - files: ./FastDeploy/diff_coverage.xml |
| 379 | + files: ./python_coverage_all.xml |
| 380 | + flags: GPU |
375 | 381 | name: python diff coverage |
| 382 | + fail_ci_if_error: false |
376 | 383 | verbose: true |
377 | 384 | disable_search: true |
378 | | - commit_parent: false |
379 | | - flags: diff |
|
0 commit comments