Skip to content

Commit

Permalink
added retry mechanism to uploading to codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
kessler-frost committed Dec 1, 2023
1 parent 8548896 commit 69dc42d
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ jobs:
&& github.event_name != 'workflow_dispatch'
&& (github.event_name == 'schedule'
|| steps.sdk-coverage.outcome == 'success')
uses: codecov/codecov-action@v3
uses: AgnostiqHQ/covalent/.github/workflows/upload_to_codecov_with_retry.yml@develop
with:
files: ./sdk_coverage.xml
flags: SDK
Expand All @@ -312,7 +312,7 @@ jobs:
&& github.event_name != 'workflow_dispatch'
&& (github.event_name == 'schedule'
|| steps.dispatcher-coverage.outcome == 'success')
uses: codecov/codecov-action@v3
uses: AgnostiqHQ/covalent/.github/workflows/upload_to_codecov_with_retry.yml@develop
with:
files: ./dispatcher_coverage.xml
flags: Dispatcher
Expand All @@ -325,7 +325,7 @@ jobs:
env.RECOMMENDED_PLATFORM
&& github.event_name != 'workflow_dispatch'
&& steps.functional-coverage.outcome == 'success'
uses: codecov/codecov-action@v3
uses: AgnostiqHQ/covalent/.github/workflows/upload_to_codecov_with_retry.yml@develop
with:
files: ./functional_tests_coverage.xml
flags: Functional_Tests
Expand All @@ -339,7 +339,7 @@ jobs:
&& github.event_name != 'workflow_dispatch'
&& (github.event_name == 'schedule'
|| steps.ui-backend-coverage.outcome == 'success')
uses: codecov/codecov-action@v3
uses: AgnostiqHQ/covalent/.github/workflows/upload_to_codecov_with_retry.yml@develop
with:
files: ./ui_backend_coverage.xml
flags: UI_Backend
Expand All @@ -353,7 +353,7 @@ jobs:
&& github.event_name != 'workflow_dispatch'
&& (github.event_name == 'schedule'
|| steps.ui-frontend-tests.outcome == 'success')
uses: codecov/codecov-action@v3
uses: AgnostiqHQ/covalent/.github/workflows/upload_to_codecov_with_retry.yml@develop
with:
files: ./covalent_ui/webapp/coverage/clover.xml
flags: UI_Frontend
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/upload_to_codecov_with_retry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Copyright 2023 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the Apache License 2.0 (the "License"). A copy of the
# License may be obtained with this software package or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Use of this file is prohibited except in compliance with the License.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: upload-to-codecov-with-retry

on:
workflow_call:
inputs:
files:
required: true
type: string
flags:
required: true
type: string
name:
required: true
type: string


jobs:
upload_to_codecov:
name: Upload coverage to Codecov
steps:
- name: Upload try 1
id: upload-1
uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ${{ github.event.inputs.files }}
flags: ${{ github.event.inputs.flags }}
name: ${{ github.event.inputs.name }}

- name: Wait 10 seconds
run: sleep 10

- name: Upload try 2
id: upload-2
if: steps.upload-1.outcome == 'failure'
uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ${{ github.event.inputs.files }}
flags: ${{ github.event.inputs.flags }}
name: ${{ github.event.inputs.name }}

- name: Wait 10 seconds
run: sleep 10

- name: Upload try 3
id: upload-3
if: steps.upload-2.outcome == 'failure'
uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ${{ github.event.inputs.files }}
flags: ${{ github.event.inputs.flags }}
name: ${{ github.event.inputs.name }}

- name: Wait 10 seconds
run: sleep 10

- name: Upload try 4
id: upload-4
if: steps.upload-3.outcome == 'failure'
uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ${{ github.event.inputs.files }}
flags: ${{ github.event.inputs.flags }}
name: ${{ github.event.inputs.name }}

- name: Wait 10 seconds
run: sleep 10

- name: Upload try 5
id: upload-5
if: steps.upload-4.outcome == 'failure'
uses: codecov/codecov-action@v3
with:
files: ${{ github.event.inputs.files }}
flags: ${{ github.event.inputs.flags }}
name: ${{ github.event.inputs.name }}
fail_ci_if_error: true

0 comments on commit 69dc42d

Please sign in to comment.