From 6922a65ff1396cc00a5a7f71a2a798c019f8308f Mon Sep 17 00:00:00 2001 From: Ziya Suzen Date: Thu, 31 Aug 2023 18:30:29 +0100 Subject: [PATCH] Retry server installs for CI (#118) --- .github/workflows/perf.yml | 5 ++++- .github/workflows/test.yml | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 8b1cf242e..e4c4c7413 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -27,7 +27,10 @@ jobs: wget https://github.com/nats-io/natscli/releases/download/v$rel/nats-$rel-linux-amd64.zip unzip nats-$rel-linux-amd64.zip sudo mv nats-$rel-linux-amd64/nats /usr/local/bin - curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh + for i in 1 2 3 + do + curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh && break || sleep 30 + done sudo mv nats-server /usr/local/bin - name: Check nats diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cb0f0baa..cee691711 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,10 @@ jobs: steps: - name: Install nats-server run: | - curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh + for i in 1 2 3 + do + curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh && break || sleep 30 + done sudo mv nats-server /usr/local/bin - name: Check nats-server @@ -74,7 +77,10 @@ jobs: shell: bash run: | mkdir tools-nats-server && cd tools-nats-server - curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh + for i in 1 2 3 + do + curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@${{ matrix.config.branch }} | PREFIX=. sh && break || sleep 30 + done mv nats-server nats-server.exe cygpath -w "$(pwd)" | tee -a "$GITHUB_PATH"