From 0139181466e3bb0922307cac92841a7dbede338a Mon Sep 17 00:00:00 2001 From: Tsuf Cohen <39455181+tsuf239@users.noreply.github.com> Date: Mon, 14 Aug 2023 11:57:01 +0300 Subject: [PATCH] chore(sdk): adding auto retry to the sdk gh workflow (#3770) From the few runs I looked into, it seems like the reason for failure is either a network error installing wing (is it blocked by NPM in any way?) or occasional fails in the tests themselves... I added a retry option to make them more stable: https://github.com/winglang/wing/actions/runs/5818534372 ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [ ] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*. --- .github/workflows/tf-aws-test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tf-aws-test.yml b/.github/workflows/tf-aws-test.yml index fbbd86559bd..6b793e4d2ad 100644 --- a/.github/workflows/tf-aws-test.yml +++ b/.github/workflows/tf-aws-test.yml @@ -44,7 +44,12 @@ jobs: with: node-version: 18 - name: Install winglang globally - run: npm install -g winglang + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 5 + command: npm install -g winglang - name: Installing external js modules run: | cd examples/tests/sdk_tests @@ -56,10 +61,15 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} - name: Execute wing test in matrix directory + uses: nick-fields/retry@v2 env: TF_LOG: info TF_LOG_PATH: ${{ runner.workspace }}/terraform.log - run: wing test -t tf-aws ${{ matrix.test.directory }}/*.w + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 20 + command: wing test -t tf-aws ${{ matrix.test.directory }}/*.w - name: Output Terraform log if: failure() run: cat ${{ runner.workspace }}/terraform.log