From aa9b93eee552671cbdda248950cac8e7f2c5a2f0 Mon Sep 17 00:00:00 2001 From: shum Date: Mon, 21 Apr 2025 14:17:42 +0000 Subject: [PATCH] ci: retry only in stable or release --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69f568a78..58ed41137 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -247,12 +247,15 @@ jobs: - name: Test if: matrix.should_run == true + timeout-minutes: 120 shell: bash env: PGHOST: localhost run: | i=1 - while [ "$i" -le 10 ]; do + attempts=1 + ${{ (github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/tags/v')) }} && attempts=3 + while [ "$i" -le "$attempts" ]; do if ./simplexmq-test; then break else @@ -261,7 +264,7 @@ jobs: sleep 1 fi done - if [ "$i" -gt 10 ]; then - echo "All 10 attempts failed." + if [ "$i" -gt "$attempts" ]; then + echo "All "$attempts" attempts failed." exit 1 fi