From 73dd9486984d778a2b705de79d1743e014f6cf93 Mon Sep 17 00:00:00 2001 From: Sasha <118575614+weboko@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:27:25 +0200 Subject: [PATCH] chore: add retry to test steps in CI (#1517) * chore: add retry to test steps of ci * use another action for retry * fix version * use master version * test with error * return working version * add env var * return node test --- .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86ff8122a8..63438805ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ on: env: NODE_JS: "18" + RETRY_ATTEMPTS: 3 jobs: check: @@ -72,10 +73,15 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: ./.github/actions/npm + - run: npm run build:esm - - run: npm run test:node - env: - DEBUG: "" + + - uses: Wandalen/wretry.action@master + with: + attempt_limit: ${{ env.RETRY_ATTEMPTS }} + command: npm run test:node + with: | + DEBUG: "" - name: Upload debug logs on failure uses: actions/upload-artifact@v3 @@ -104,10 +110,15 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: ./.github/actions/npm + - run: npm run build:esm - - run: npm run test:optional --workspace=@waku/tests - env: - DEBUG: "" + + - uses: Wandalen/wretry.action@master + with: + attempt_limit: ${{ env.RETRY_ATTEMPTS }} + command: npm run test:optional --workspace=@waku/tests + with: | + DEBUG: "" node_with_go_waku_master: runs-on: ubuntu-latest @@ -124,10 +135,15 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: ./.github/actions/npm + - run: npm run build:esm - - run: npm run test:node - env: - DEBUG: "waku:nwaku*,waku:test*" + + - uses: Wandalen/wretry.action@master + with: + attempt_limit: ${{ env.RETRY_ATTEMPTS }} + command: npm run test:node + with: | + DEBUG: "waku:nwaku*,waku:test*" - name: Upload debug logs on failure uses: actions/upload-artifact@v3 @@ -156,10 +172,15 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: ./.github/actions/npm + - run: npm run build:esm - - run: npm run test:node - env: - DEBUG: "waku:nwaku*,waku:test*" + + - uses: Wandalen/wretry.action@master + with: + attempt_limit: ${{ env.RETRY_ATTEMPTS }} + command: npm run test:node + with: | + DEBUG: "waku:nwaku*,waku:test*" - name: Upload debug logs on failure uses: actions/upload-artifact@v3