|
43 | 43 | runs-on: [self-hosted, GPU-h1z1-2Cards] |
44 | 44 | timeout-minutes: 90 |
45 | 45 | needs: check_cov_skip |
| 46 | + if: needs.check_cov_skip.outputs.can-skip != 'true' |
46 | 47 | outputs: |
47 | | - 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 }} |
48 | 49 | unittest_failed_url: ${{ steps.cov_upload.outputs.unittest_failed_url }} |
49 | 50 | diff_cov_result_json_url: ${{ steps.cov_upload.outputs.diff_cov_result_json_url }} |
50 | 51 | steps: |
@@ -173,7 +174,7 @@ jobs: |
173 | 174 | git config --global --add safe.directory /workspace/FastDeploy |
174 | 175 | cd FastDeploy |
175 | 176 | git diff origin/${BASE_REF}..HEAD --unified=0 > diff.txt |
176 | | - python -m pip install paddlepaddle-gpu==3.3.0.dev20251112 -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/ |
177 | 178 | pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple |
178 | 179 |
|
179 | 180 | python -m pip install -r scripts/unittest_requirement.txt |
@@ -201,7 +202,7 @@ jobs: |
201 | 202 | if [[ "$IS_PR" == "true" ]]; then |
202 | 203 | echo "Running diff coverage for PR..." |
203 | 204 | diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9 |
204 | | - 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 |
205 | 206 | else |
206 | 207 | echo "Running full coverage" |
207 | 208 | coverage report -m > full_coverage_report.txt |
@@ -249,15 +250,15 @@ jobs: |
249 | 250 |
|
250 | 251 | target_path_stripped="${target_path#paddle-github-action/}" |
251 | 252 |
|
252 | | - if [[ "$IS_PR" == "true" ]]; then |
253 | | - diff_cov_file="diff_coverage.xml" |
254 | | - if [ -f ${diff_cov_file} ]; then |
255 | | - python ${push_file} ${diff_cov_file} ${target_path}/CoverageData |
256 | | - DIFF_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${diff_cov_file} |
257 | | - echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_OUTPUT |
258 | | - echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_ENV |
259 | | - 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 |
260 | 260 |
|
| 261 | + if [[ "$IS_PR" == "true" ]]; then |
261 | 262 | diff_cov_result_json="diff_coverage.json" |
262 | 263 | if [ -f ${diff_cov_result_json} ]; then |
263 | 264 | python ${push_file} ${diff_cov_result_json} ${target_path}/CoverageData |
@@ -319,7 +320,7 @@ jobs: |
319 | 320 | echo "All tests passed" |
320 | 321 |
|
321 | 322 | - name: Verify Code Coverage Threshold (80%) |
322 | | - if: ${{ github.event_name == 'pull_request' && (needs.check_cov_skip.outputs['can-skip'] != 'true') }} |
| 323 | + if: ${{ github.event_name == 'pull_request' }} |
323 | 324 | shell: bash |
324 | 325 | run: | |
325 | 326 | cd FastDeploy |
@@ -351,28 +352,33 @@ jobs: |
351 | 352 | runs-on: ubuntu-latest |
352 | 353 | timeout-minutes: 15 |
353 | 354 | env: |
354 | | - fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }} |
| 355 | + all_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.all_cov_file_url }} |
355 | 356 | steps: |
356 | | - - 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 |
357 | 365 | shell: bash |
358 | | - env: |
359 | | - diff_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url }} |
360 | 366 | run: | |
361 | | - wget -q --no-proxy ${fd_archive_url} |
362 | | - tar -xf FastDeploy.tar.gz |
363 | | - cd FastDeploy |
364 | | - if [ -z "${diff_cov_file_url}" ]; then |
365 | | - 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." |
366 | 370 | exit 0 |
367 | 371 | fi |
368 | | - 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 | +
|
369 | 375 | - name: Upload diff coverage report |
370 | | - if: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url != null && needs.run_tests_with_coverage.outputs.diff_cov_file_url != '' }} |
371 | | - uses: codecov/codecov-action@v5 |
| 376 | + if: always() && hashFiles('python_coverage_all.xml') != '' |
| 377 | + uses: codecov/codecov-action@v4 |
372 | 378 | with: |
373 | | - files: ./FastDeploy/diff_coverage.xml |
| 379 | + files: ./python_coverage_all.xml |
| 380 | + flags: GPU |
374 | 381 | name: python diff coverage |
| 382 | + fail_ci_if_error: false |
375 | 383 | verbose: true |
376 | 384 | disable_search: true |
377 | | - commit_parent: false |
378 | | - flags: diff |
|
0 commit comments