Skip to content

Commit

Permalink
CI: Fix retry action (#306)
Browse files Browse the repository at this point in the history
Co-authored-by: Mathieu Scheltienne <mathieu.scheltienne@gmail.com>
  • Loading branch information
larsoner and mscheltienne authored Aug 6, 2024
1 parent e661788 commit 81bcef3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/actions/retry-step/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ inputs:
default: "3"
retry_error_codes:
description: "The error code on which to trigger a retry."
required: false
default: "134,139"
required: true
command_between_retries:
description: "A command to run between retries."
required: false
Expand All @@ -23,6 +22,7 @@ runs:
id: retry
shell: bash
run: |
set -eo pipefail
command="${{ inputs.command }}"
max_attempts=${{ inputs.max_attempts }}
retry_error_codes=${{ inputs.retry_error_codes }}
Expand All @@ -33,8 +33,10 @@ runs:
until [ $attempt -gt $max_attempts ]
do
(eval $command)
set +e
eval $command
exit_code=$?
set -e
retry=false
for code in "${retry_codes[@]}"; do
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
uses: ./.github/actions/retry-step
with:
command: pytest mne_lsl --cov=mne_lsl --cov-report=xml --cov-config=pyproject.toml -s
retry_error_codes: "3,134,139"
env:
MNE_LSL_LOG_LEVEL: DEBUG
- name: Upload to codecov
Expand Down Expand Up @@ -90,6 +91,7 @@ jobs:
uses: ./.github/actions/retry-step
with:
command: pytest mne_lsl --cov=mne_lsl --cov-report=xml --cov-config=pyproject.toml -s
retry_error_codes: "3,134,139"
env:
MNE_LSL_LOG_LEVEL: DEBUG
- name: Upload to codecov
Expand Down Expand Up @@ -138,6 +140,7 @@ jobs:
uses: ./.github/actions/retry-step
with:
command: pytest mne_lsl --cov=mne_lsl --cov-report=xml --cov-config=pyproject.toml -s
retry_error_codes: "3,134,139"
env:
MNE_LSL_LOG_LEVEL: DEBUG
- name: Upload to codecov
Expand Down

0 comments on commit 81bcef3

Please sign in to comment.