Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fault-tolerant codecov upload action #42

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions codecov-upload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Upload coverage to Codecov
description: Fault tolerant unlike codecov/codecov-action

inputs:
name:
description: Custom defined name for the upload
required: false
flags:
description: Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome)
required: false
fail_ci_if_error:
description: Specify if CI pipeline should fail when Codecov runs into errors during upload. Defaults to false
required: false

runs:
using: composite
steps:
- id: upload
uses: codecov/codecov-action@v3
continue-on-error: true
with:
name: ${{ inputs.name }}
flags: ${{ inputs.flags }}
fail_ci_if_error: true

- if: failure() && steps.upload.outcome == 'failure'
shell: bash
env:
DELAY: '20'
run: |
echo "::error::Failed to upload, retrying in ${DELAY}s ..."
sleep "$DELAY"

- if: failure() && steps.upload.outcome == 'failure'
uses : codecov/codecov-action@v3
with:
name: ${{ inputs.name }}
flags: ${{ inputs.flags }}
fail_ci_if_error: ${{ inputs.fail_ci_if_error }}