Skip to content

Commit b0c3a62

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

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
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: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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,26 @@ 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: fromJSON(github.run_attempt) < 3
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+
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
657+
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
658+
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
659+
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
660+
661+
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
662+
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
663+
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
664+
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
665+
666+
if [[ $RNTESTER_ANDROID_FAILED || $TEMPLATE_ANDROID_FAILED || $RNTESTER_IOS_FAILED || $TEMPLATE_IOS_FAILED ]]; then
667+
echo "Rerunning failed jobs in the current workflow"
668+
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
669+
fi

0 commit comments

Comments
 (0)