Skip to content

Commit 3f6e554

Browse files
committed
[RN][CI] Fix workflow-retry for android
1 parent e7a9322 commit 3f6e554

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

.github/actions/build-android/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ runs:
4444
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
4545
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
4646
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
47-
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
47+
#export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
48+
export ORG_GRADLE_PROJECT_reactNativeArchitectures="x86"
4849
else
4950
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
5051
fi

.github/workflows/test-all.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ jobs:
187187
flavor: ${{ matrix.flavor }}
188188

189189
test_e2e_ios_rntester:
190-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
190+
#if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
191191
runs-on: macos-14-large
192192
needs:
193193
[test_ios_rntester]
@@ -221,7 +221,7 @@ jobs:
221221
flavor: ${{ matrix.flavor }}
222222

223223
test_e2e_ios_templateapp:
224-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
224+
#if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
225225
runs-on: macos-14-large
226226
needs: [build_npm_package, prebuild_apple_dependencies]
227227
env:
@@ -312,7 +312,7 @@ jobs:
312312
architecture: ${{ matrix.architecture }}
313313

314314
test_e2e_android_templateapp:
315-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
315+
#if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
316316
runs-on: 4-core-ubuntu
317317
needs: build_npm_package
318318
continue-on-error: true
@@ -439,11 +439,11 @@ jobs:
439439
uses: ./.github/actions/build-android
440440
with:
441441
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
442-
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
442+
run-e2e-tests: true # ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
443443
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
444444

445445
test_e2e_android_rntester:
446-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
446+
# if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
447447
runs-on: 4-core-ubuntu
448448
needs: [build_android]
449449
strategy:
@@ -644,12 +644,31 @@ jobs:
644644
# This is exactly the same as rerunning failed tests from the GH UI, but automated.
645645
rerun-failed-jobs:
646646
runs-on: ubuntu-latest
647-
needs: [test_e2e_ios_rntester, test_e2e_android_rntester,test_e2e_ios_templateapp, test_e2e_android_templateapp]
648-
if: failure() && fromJSON(github.run_attempt) < 3 && ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
647+
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
648+
if: always()
649649
steps:
650650
- name: Checkout
651651
uses: actions/checkout@v4
652652
- name: Rerun failed jobs in the current workflow
653653
env:
654654
GH_TOKEN: ${{ github.token }}
655-
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
655+
run: |
656+
SHOULD_RETRY=${{fromJSON(github.run_attempt) < 3}}
657+
if [[ $SHOULD_RETRY == "false" ]]; then
658+
exit 0
659+
fi
660+
661+
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
662+
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
663+
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
664+
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
665+
666+
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
667+
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
668+
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
669+
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
670+
671+
if [[ $RNTESTER_ANDROID_FAILED == "true" || $TEMPLATE_ANDROID_FAILED == "true" || $RNTESTER_IOS_FAILED == "true" || $TEMPLATE_IOS_FAILED == "true" ]]; then
672+
echo "Rerunning failed jobs in the current workflow"
673+
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
674+
fi

0 commit comments

Comments
 (0)