From ae9158cfc61661dd3063cf9d01c2a7d3c67b2c95 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:46:32 -0800 Subject: [PATCH] Add retry logic to ubuntu builds --- .github/workflows/build-tests-ubuntu.yml | 47 ++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-tests-ubuntu.yml b/.github/workflows/build-tests-ubuntu.yml index 876d5153..63914eff 100644 --- a/.github/workflows/build-tests-ubuntu.yml +++ b/.github/workflows/build-tests-ubuntu.yml @@ -76,13 +76,52 @@ jobs: Library-${{ matrix.projectPath }}-ubuntu- Library- - - name: Random Delay (to avoid activation rate limits) - run: sleep $((RANDOM % 60)) - ########################### # Build # ########################### - - uses: ./ + - name: Build + uses: ./ + id: build-1 + continue-on-error: true + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + projectPath: ${{ matrix.projectPath }} + unityVersion: ${{ matrix.unityVersion }} + targetPlatform: ${{ matrix.targetPlatform }} + customParameters: -profile SomeProfile -someBoolean -someValue exampleValue + providerStrategy: ${{ matrix.providerStrategy }} + + - name: Sleep for Retry + if: ${{ steps.build-1.outcome == 'failure' }} + run: | + sleep 60 + + - name: Build (Retry 1) + uses: ./ + id: build-2 + if: ${{ steps.build-1.outcome == 'failure' }} + continue-on-error: true + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + projectPath: ${{ matrix.projectPath }} + unityVersion: ${{ matrix.unityVersion }} + targetPlatform: ${{ matrix.targetPlatform }} + customParameters: -profile SomeProfile -someBoolean -someValue exampleValue + providerStrategy: ${{ matrix.providerStrategy }} + + - name: Sleep for Retry + if: ${{ steps.build-2.outcome == 'failure' }} + run: | + sleep 240 + + - name: Build (Retry 2) + uses: ./ + id: build-3 + if: ${{ steps.build-2.outcome == 'failure' }} env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}