Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
live-github-bot[bot] committed Jan 16, 2025
2 parents e84dc0c + c66510e commit 474d0db
Show file tree
Hide file tree
Showing 1,068 changed files with 23,914 additions and 16,905 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release-final.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: "[Release] Publish packages and apps"
on:
workflow_call:
inputs:
ref:
type: string
description: "the ref (branch) to release from"
required: false
default: main
workflow_dispatch:
inputs:
app:
Expand All @@ -17,13 +24,6 @@ on:
required: false
default: main

workflow_run:
workflows:
- \[Release\] Prepare for releasing
- \[Release\](Hotfix) Prepare for releasing
types:
- "completed"

jobs:
release:
name: Release
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
ref: "main",
workflow_id: "release-desktop.yml",
inputs: {
branch: ${{ inputs.ref }}
branch: "${{ inputs.ref }}"
}
});
- uses: actions/github-script@v7
Expand All @@ -158,6 +158,6 @@ jobs:
ref: "main",
workflow_id: "release-mobile.yml",
inputs: {
ref: ${{ inputs.ref }}
ref: "${{ inputs.ref }}"
}
});
8 changes: 8 additions & 0 deletions .github/workflows/release-prepare-hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ jobs:
gh pr create --title ":rotating_light: Hotfix Release merge conflicts" -F .github/templates/hotfix-release-conflicts.md --base release --head support/hotfix-release-merge-conflicts
fi
fi
release-final:
name: "[Release] Publish packages and apps"
needs: prepare-release
uses: LedgerHQ/ledger-live/.github/workflows/release-final.yml@develop
with:
ref: hotfix
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ jobs:
git checkout -b support/release-merge-conflicts
git push origin support/release-merge-conflicts
gh pr create --title ":rotating_light: Release merge conflicts" -F .github/templates/release-conflicts.md --base develop --head support/release-merge-conflicts
release-final:
name: "[Release] Publish packages and apps"
needs: prepare-release
uses: LedgerHQ/ledger-live/.github/workflows/release-final.yml@develop
with:
ref: main
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
cat apps/ledger-live-desktop/coverage/lld-sonar-executionTests-report.xml > ./lld-sonar-executionTests-report.xml
cat apps/ledger-live-mobile/coverage/llm-sonar-executionTests-report.xml > ./llm-sonar-executionTests-report.xml
- uses: sonarsource/sonarqube-scan-action@master
- name: SonarQube Scan
uses: sonarsource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
142 changes: 90 additions & 52 deletions .github/workflows/test-mobile-e2e-reusable.yml
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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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"
Expand All @@ -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 }}
Expand All @@ -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: |
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 474d0db

Please sign in to comment.