Skip to content

Commit

Permalink
[fix][ci] Fix Jacoco code coverage to report classes in dependent pro…
Browse files Browse the repository at this point in the history
…jects (#19264)
  • Loading branch information
lhotari authored Jan 20, 2023
1 parent 4139fef commit e3b76d4
Show file tree
Hide file tree
Showing 9 changed files with 659 additions and 87 deletions.
11 changes: 10 additions & 1 deletion .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ runs:
flags: ${{ inputs.flags }}
fail_ci_if_error: true
verbose: true
- name: "Wait 15 seconds before next attempt"
if: steps.codecov-upload-1.outcome == 'failure'
shell: bash
run: sleep 15
- name: "Upload to Codecov (attempt #2)"
id: codecov-upload-2
if: steps.codecov-upload-1.outcome == 'failure'
Expand All @@ -66,11 +70,16 @@ runs:
flags: ${{ inputs.flags }}
fail_ci_if_error: true
verbose: true
- name: "Wait 60 seconds before next attempt"
if: steps.codecov-upload-2.outcome == 'failure'
shell: bash
run: sleep 60
- name: "Upload to Codecov (attempt #3)"
id: codecov-upload-3
if: steps.codecov-upload-2.outcome == 'failure'
uses: codecov/codecov-action@v3
continue-on-error: true
# fail on last attempt
continue-on-error: false
with:
flags: ${{ inputs.flags }}
fail_ci_if_error: true
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pulsar-ci-flaky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ jobs:
if: ${{ always() }}
uses: ./.github/actions/copy-test-reports

- name: Create Jacoco reports
run: |
$GITHUB_WORKSPACE/build/pulsar_ci_tool.sh create_test_coverage_report
cd $GITHUB_WORKSPACE/target
zip -r jacoco_test_coverage_report_flaky.zip jacoco_test_coverage_report
- name: Upload Jacoco report files to build artifacts
uses: actions/upload-artifact@v3
with:
name: Jacoco-coverage-report-flaky
path: target/jacoco_test_coverage_report_flaky.zip
retention-days: 3

- name: Upload to Codecov
uses: ./.github/actions/upload-coverage
with:
Expand Down
Loading

0 comments on commit e3b76d4

Please sign in to comment.