diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index b17c36bff13d..b4a1f8c26a52 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -201,6 +201,17 @@ jobs: AVD_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none outputs: status: ${{ steps.detox.outcome }} + strategy: + fail-fast: false + matrix: + shardIndex: [1, 2, 3] + shardTotal: [3, 1] + exclude: + - shardIndex: ${{ github.event.inputs.speculos_tests == 'false' && '2' }} + - shardIndex: ${{ github.event.inputs.speculos_tests == 'false' && '3' }} + - shardTotal: ${{ github.event.inputs.speculos_tests == 'false' && '3' }} + - shardTotal: ${{ github.event.inputs.speculos_tests != 'false' && '1' }} + steps: - uses: actions/checkout@v4 with: @@ -292,7 +303,7 @@ jobs: bot_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} - name: Run Android Tests id: detox - run: pnpm mobile e2e:ci -p android -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos') + run: pnpm mobile e2e:ci -p android -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos') --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} timeout-minutes: ${{ env.SPECULOS_RUN && 120 || 45 }} env: DETOX_INSTALL_TIMEOUT: 120000 @@ -302,13 +313,13 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ !cancelled() || steps.detox.outcome == 'cancelled' }} with: - name: "android-test-artifacts" + name: "android-test-artifacts-${{ matrix.shardIndex }}" path: apps/ledger-live-mobile/artifacts/ allure-report-android: name: "Allure Reports Export on Server" runs-on: [ledger-live-medium] - if: ${{ always() && (inputs.slack_notif || github.event_name == 'push') }} + if: ${{ always() && (inputs.slack_notif || github.event_name == 'push' || github.event_name == 'schedule') }} outputs: report-url: ${{ steps.upload.outputs.report-url }} result: ${{ steps.summary.outputs.test_result }} diff --git a/apps/ledger-live-mobile/scripts/e2e-ci.mjs b/apps/ledger-live-mobile/scripts/e2e-ci.mjs index 3d707e2cbd69..01071b0b4a6a 100755 --- a/apps/ledger-live-mobile/scripts/e2e-ci.mjs +++ b/apps/ledger-live-mobile/scripts/e2e-ci.mjs @@ -4,12 +4,13 @@ import { basename } from "path"; let platform, test, build, bundle; let speculos = ""; let cache = true; +let shard = ""; const usage = (exitCode = 1) => { console.log( `Usage: ${basename( __filename, - )} -p --platform [-h --help] [-t --test] [-b --build] [--bundle] [--cache | --no-cache] [--speculos]`, + )} -p --platform [-h --help] [-t --test] [-b --build] [--bundle] [--cache | --no-cache] [--speculos] [--shard]`, ); process.exit(exitCode); }; @@ -63,7 +64,8 @@ const test_android = async () => { --headless \\ --retries 1 \\ --runInBand \\ - --cleanup`; + --cleanup \\ + --shard ${shard}`; }; const getTasksFrom = { @@ -112,6 +114,9 @@ for (const argName in argv) { case "speculos": speculos = ":speculos"; break; + case "shard": + shard = argv[argName]; + break; default: usage(42); break;