-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,068 changed files
with
23,914 additions
and
16,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: "Test Mobile E2E" | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * 1-5" | ||
workflow_call: | ||
workflow_dispatch: | ||
inputs: | ||
|
@@ -55,12 +57,13 @@ permissions: | |
env: | ||
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11 | ||
COINAPPS: ${{ github.workspace }}/coin-apps | ||
SPECULOS_RUN: ${{ inputs.speculos_tests || github.event_name == 'schedule' }} | ||
|
||
jobs: | ||
detox-tests-ios: | ||
name: "LLM - iOS Detox Tests" | ||
runs-on: [m1, ARM64] | ||
if: ${{ !inputs.speculos_tests }} | ||
if: ${{ !inputs.speculos_tests && github.event_name != 'schedule' }} | ||
env: | ||
NODE_OPTIONS: "--max-old-space-size=7168" | ||
LANG: en_US.UTF-8 | ||
|
@@ -88,6 +91,13 @@ jobs: | |
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID_PROD }}:role/${{ secrets.AWS_CACHE_ROLE_NAME }} | ||
aws-region: ${{ secrets.AWS_CACHE_REGION }} | ||
- uses: nick-fields/retry@v3 | ||
name: install dependencies | ||
with: | ||
max_attempts: 2 | ||
timeout_minutes: 15 | ||
command: pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm | ||
new_command_on_retry: rm -rf ~/.cocoapods/ && pnpm clean && pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm | ||
- name: cache detox build | ||
uses: tespkg/actions-cache@v1 | ||
if: steps.aws.conclusion == 'success' | ||
|
@@ -101,13 +111,6 @@ jobs: | |
bucket: ll-gha-s3-cache | ||
region: ${{ secrets.AWS_CACHE_REGION }} | ||
use-fallback: false | ||
- uses: nick-fields/retry@v3 | ||
name: install dependencies | ||
with: | ||
max_attempts: 2 | ||
timeout_minutes: 15 | ||
command: pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm | ||
new_command_on_retry: rm -rf ~/.cocoapods/ && pnpm clean && pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm | ||
- name: Build dependencies | ||
run: | | ||
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" | ||
|
@@ -127,7 +130,7 @@ jobs: | |
if: steps.detox-build.outputs.cache-hit == 'true' | ||
run: pnpm mobile e2e:ci -p ios --bundle | ||
- name: Setup Speculos image and Coin Apps | ||
if: ${{ inputs.speculos_tests }} | ||
if: ${{ env.SPECULOS_RUN == 'true' }} | ||
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop | ||
with: | ||
coinapps_path: ${{ env.COINAPPS }} | ||
|
@@ -140,7 +143,7 @@ jobs: | |
run: pnpm mobile e2e:ci -p ios -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos') | ||
env: | ||
SEED: ${{ secrets.SEED_QAA_B2C }} | ||
INPUT_SPECULOS: ${{ inputs.speculos_tests }} | ||
INPUT_SPECULOS: ${{ env.SPECULOS_RUN }} | ||
- name: Delete iOS simulator | ||
if: ${{ always() && steps.simulator.outputs.id }} | ||
run: | | ||
|
@@ -198,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' || github.event_name == 'push' || github.event_name == 'pull_request') && '2' }} | ||
- shardIndex: ${{ (github.event.inputs.speculos_tests == 'false' || github.event_name == 'push' || github.event_name == 'pull_request') && '3' }} | ||
- shardTotal: ${{ (github.event.inputs.speculos_tests == 'false' || github.event_name == 'push' || github.event_name == 'pull_request') && '3' }} | ||
- shardTotal: ${{ github.event.inputs.speculos_tests != 'false' && github.event_name != 'push' && github.event_name != 'pull_request' && '1' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -280,7 +294,7 @@ jobs: | |
emulator-options: ${{ env.AVD_OPTIONS }} | ||
script: ./tools/scripts/wait_emulator_idle.sh | ||
- name: Setup Speculos image and Coin Apps | ||
if: ${{ inputs.speculos_tests }} | ||
if: ${{ env.SPECULOS_RUN == 'true' }} | ||
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop | ||
with: | ||
coinapps_path: ${{ env.COINAPPS }} | ||
|
@@ -289,23 +303,23 @@ 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') | ||
timeout-minutes: 45 | ||
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 | ||
SEED: ${{ secrets.SEED_QAA_B2C }} | ||
INPUT_SPECULOS: ${{ inputs.speculos_tests }} | ||
INPUT_SPECULOS: ${{ env.SPECULOS_RUN }} | ||
- name: Upload test artifacts | ||
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 }} | ||
|
@@ -391,7 +405,7 @@ jobs: | |
report-on-slack: | ||
runs-on: ubuntu-22.04 | ||
needs: [allure-report-android, allure-report-ios] | ||
if: ${{ (failure() && github.event_name == 'push') || (always() && inputs.slack_notif) }} | ||
if: ${{ (failure() && github.event_name == 'push') || (always() && (inputs.slack_notif || github.event_name == 'schedule')) }} | ||
env: | ||
IOS_STATUS: ${{ needs.allure-report-ios.outputs.status }} | ||
IOS_REPORT_URL: ${{ needs.allure-report-ios.outputs.report-url }} | ||
|
@@ -404,75 +418,99 @@ jobs: | |
with: | ||
script: | | ||
const fs = require("fs"); | ||
const workflowLink = `<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow run> for more informations`; | ||
const text = `Detox tests finished: ${workflowLink}`; | ||
const iOSResult = [ | ||
const text = "Ledger Live Mobile E2E tests finished"; | ||
const header = [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": `${process.env.IOS_STATUS !== 'success' ? '🍏 iOS Detox tests failed ❌' : '🍏 iOS Detox tests succeeded ✅'}`, | ||
"text": process.env.SPECULOS_RUN == 'false' | ||
? "Ledger Live Mobile Mocked Tests on ${{ github.ref_name }}" | ||
: ":ledger-logo: Ledger Live Mobile E2E nightly tests results on ${{ github.ref_name }}", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": `${{ needs.allure-report-ios.outputs.result || 'No test results' }}` | ||
} | ||
}, | ||
"type": "divider" | ||
} | ||
]; | ||
const iOSResult = [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": process.env.IOS_REPORT_URL ? `<${process.env.IOS_REPORT_URL}|Allure Report iOS>` : 'No Allure Report' | ||
"text": `- 🍏 iOS: ${process.env.IOS_STATUS !== 'success' ? '❌' : '✅'} ${{ needs.allure-report-ios.outputs.result || 'No test results' }}` | ||
} | ||
} | ||
]; | ||
const androidResult = [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": `${process.env.ANDROID_STATUS !== 'success' ? '🤖 Android Detox tests failed ❌' : '🤖 Android Detox tests succeeded ✅'}`, | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": `${{ needs.allure-report-android.outputs.result || 'No test results' }}` | ||
"text": `- 🤖 Android: ${process.env.ANDROID_STATUS !== 'success' ? '❌' : '✅'} ${{ needs.allure-report-android.outputs.result || 'No test results' }}` | ||
} | ||
}, | ||
} | ||
]; | ||
const iOSInfo = [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": process.env.ANDROID_REPORT_URL ? `<${process.env.ANDROID_REPORT_URL}|Allure Report Android>` : 'No Allure Report' | ||
} | ||
"type": "mrkdwn", | ||
"text": process.env.IOS_REPORT_URL ? `*Allure Report iOS*\n<${process.env.IOS_REPORT_URL}|Allure Report iOS>` : '*Allure Report iOS*\nNo Allure Report' | ||
} | ||
]; | ||
const androidInfo = [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": process.env.ANDROID_REPORT_URL ? `*Allure Report Android*\n<${process.env.ANDROID_REPORT_URL}|Allure Report Android>` : '*Allure Report Android*\nNo Allure Report' | ||
} | ||
]; | ||
const infoFields = [] | ||
.concat(${{ env.SPECULOS_RUN == 'true' }} ? [] : iOSInfo) | ||
.concat(androidInfo) | ||
.concat([ | ||
{ | ||
"type": "mrkdwn", | ||
"text": `*Workflow*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow run>` | ||
} | ||
]); | ||
const infoBlock = [ | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": workflowLink | ||
} | ||
"fields": infoFields | ||
} | ||
]; | ||
const result = { | ||
text, | ||
blocks: [...iOSResult, ...androidResult, ...infoBlock] | ||
}; | ||
const blocks = [] | ||
.concat(header) | ||
.concat(${{ env.SPECULOS_RUN == 'true' }} ? [] : iOSResult) | ||
.concat(androidResult) | ||
.concat(infoBlock); | ||
const result = process.env.SPECULOS_RUN === 'false' | ||
? { | ||
text, | ||
blocks, | ||
} | ||
: { | ||
attachments: [ | ||
{ | ||
color: process.env.ANDROID_STATUS !== 'success' | ||
? "#FF333C" | ||
: "#33FF39", | ||
blocks, | ||
}, | ||
], | ||
}; | ||
fs.writeFileSync(`./payload-slack-content.json`, JSON.stringify(result, null, 2)); | ||
- name: post to a Slack channel | ||
|
@@ -484,7 +522,7 @@ jobs: | |
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} | ||
- name: post to a Slack channel | ||
if: ${{ github.event_name == 'push' && contains(fromJson('["develop", "main"]'), github.ref_name) }} | ||
if: ${{ github.event_name == 'push' && contains(fromJson('["develop", "main"]'), github.ref_name) || github.event_name == 'schedule' }} | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: "C05FKJ7DFAP" | ||
|
Oops, something went wrong.