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 Sep 17, 2024
2 parents 13d1e16 + a496e0a commit 26e7b94
Show file tree
Hide file tree
Showing 1,454 changed files with 98,222 additions and 23,099 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test-mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ on:
base_ref:
description: The base branch to merge the head into when checking out the code
required: false
export_to_xray:
description: Send tests results to Xray
required: false
type: boolean
default: false
test_execution_android:
description: "[Android] Test Execution ticket ID. Ex: 'B2CQA-2461'"
required: false
type: string
test_execution_ios:
description: "[iOS] Test Execution ticket ID. Ex: 'B2CQA-2461'"
required: false
type: string

# Uncomment to have log-level: trace on detox run and build
# (cf: apps/ledger-live-mobile/detox.config.js)
Expand Down Expand Up @@ -287,6 +300,63 @@ jobs:
password: ${{ secrets.ALLURE_LEDGER_LIVE_PASSWORD }}
path: android-test-artifacts

upload-to-xray:
name: "Upload to Xray"
runs-on: [ledger-live-medium]
strategy:
matrix:
platform:
- android
- ios
fail-fast: false
env:
XRAY_CLIENT_ID: ${{ secrets.XRAY_CLIENT_ID }}
XRAY_CLIENT_SECRET: ${{ secrets.XRAY_CLIENT_SECRET }}
XRAY_API_URL: https://xray.cloud.getxray.app/api/v2
JIRA_URL: https://ledgerhq.atlassian.net/browse
TEST_EXECUTION: ${{ matrix.platform == 'android' && inputs.test_execution_android || inputs.test_execution_ios }}
needs: [detox-tests-android, detox-tests-ios]
if: ${{ !cancelled() && inputs.export_to_xray }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Download Allure Results
uses: actions/download-artifact@v4
with:
path: "artifacts-${{ matrix.platform }}"
name: ${{ matrix.platform }}-test-artifacts

- name: Format Xray results
run: apps/ledger-live-mobile/e2e/xray.formater.sh artifacts-${{ matrix.platform }} ${{ matrix.platform }} ${{ env.TEST_EXECUTION}}

- name: Upload aggregated xray results
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: xray-reports-${{ matrix.platform }}
path: "artifacts-${{ matrix.platform }}/xray_report.json"

- name: Authenticate to Xray
id: authenticate
run: |
response=$(curl -H "Content-Type: application/json" -X POST --data '{"client_id": "${{ env.XRAY_CLIENT_ID }}", "client_secret": "${{ env.XRAY_CLIENT_SECRET }}"}' ${{ env.XRAY_API_URL }}/authenticate)
echo "xray_token=$response" >> $GITHUB_OUTPUT
- name: Publish report on Xray
id: publish-xray
run: |
response=$(curl -H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ steps.authenticate.outputs.xray_token }}" \
-X POST \
--data @artifacts-${{ matrix.platform }}/xray_report.json \
${{ env.XRAY_API_URL }}/import/execution)
key=$(echo $response | jq -r '.key')
echo "xray_key=$key" >> $GITHUB_OUTPUT
- name: Write Xray report link in summary
shell: bash
run: echo "::notice title=${{ matrix.platform }} Xray report URL::${{ env.JIRA_URL }}/${{ steps.publish-xray.outputs.xray_key }}"

report:
needs: [detox-tests-android, detox-tests-ios]
runs-on: ubuntu-latest
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ permissions:
jobs:
e2e-tests-linux:
name: "Desktop Tests E2E (Ubuntu)"
outputs:
status: ${{ steps.tests.outcome }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
INSTRUMENT_BUILD: true
Expand All @@ -78,7 +76,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Setup broadcast environment variables
id: set-env
run: |
Expand All @@ -98,28 +96,33 @@ jobs:
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}

- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@develop
id: setup-test-desktop
with:
skip_ruby: true
install_playwright: true
turborepo-server-port: ${{ steps.caches.outputs.port }}

- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_BOT_APP_ID }}
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}

- name: Retrieving coin apps
uses: actions/checkout@v4
with:
ref: master
repository: LedgerHQ/coin-apps
token: ${{ steps.generate-token.outputs.token }}
path: coin-apps

- name: Pull docker image
run: docker pull ${{ env.SPECULOS_IMAGE_TAG }}
shell: bash

- name: Run playwright tests [Linux => xvfb-run]
id: tests
run: |
Expand Down Expand Up @@ -188,6 +191,7 @@ jobs:

- name: Get summary
if: ${{ !cancelled() }}
id: summary
shell: bash
run: |
cd apps/ledger-live-desktop
Expand All @@ -200,15 +204,12 @@ jobs:
totalTests=$(jq '.statistic.total' summary.json)
echo "TEST_RESULT=$passedTests passed, $failedTests failed, $brokenTests broken, $skippedTests skipped, $totalTests total" >> $GITHUB_ENV
- name: Get status color
if: ${{ !cancelled() }}
shell: bash
run: >
if ${{ needs.e2e-tests-linux.outputs.status == 'success' }};
then echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV;
elif ${{ needs.e2e-tests-linux.outputs.status == 'failure' }};
then echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV;
else echo "STATUS_COLOR=#F3FF33" >> $GITHUB_ENV;
if [ "$failedTests" -gt 0 ] || [ "$brokenTests" -gt 0 ]; then
echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV;
echo "STATUS_EMOJI=❌" >> $GITHUB_ENV;
else
echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV;
echo "STATUS_EMOJI=✅" >> $GITHUB_ENV;
fi
- uses: actions/github-script@v6
Expand Down Expand Up @@ -246,6 +247,7 @@ jobs:
status: "${{ needs.e2e-tests-linux.outputs.status }}",
}
};
const statusEmoji = process.env.STATUS_EMOJI;
let summary = `### Playwright Tests
`
Expand All @@ -270,7 +272,7 @@ jobs:
|`;
Object.entries(report).forEach(([os, values]) => {
summary += ` ${values.pass ? "✅" : "❌"} (${values.status}) |`;
summary += ` ${values.pass ? statusEmoji : "❌"} (${values.status}) |`;
});
summary += `
Expand Down Expand Up @@ -318,7 +320,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": `- 🐧 linux: ${report.linux.pass ? "✅" : "❌"} ${process.env.TEST_RESULT || 'No test results'}`
"text": `- 🐧 linux: ${statusEmoji} ${process.env.TEST_RESULT || 'No test results'}`
}
},
{
Expand Down Expand Up @@ -356,6 +358,7 @@ jobs:
payload-file-path: ${{ github.workspace }}/payload-slack-content.json
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_LIVE_CI_BOT_TOKEN }}
STATUS_COLOR: ${{ env.STATUS_COLOR }}

upload-to-xray:
name: "Upload to Xray"
Expand Down
6 changes: 4 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ apps/ledger-live-mobile/src/newArch/features/Web3Hub/ @ledgerhq/wallet-api
# Devices team
apps/cli/src/commands/devices @ledgerhq/live-devices
**/src/renderer/screens/manager/ @ledgerhq/live-devices
**/screens/CustomImage @ledgerhq/live-devices
**/components/CustomImage @ledgerhq/live-devices
**/screens/customImage @ledgerhq/live-devices
**/components/CustomImage @ledgerhq/live-devices
**/screens/CustomImage @ledgerhq/live-devices
**/SyncOnboarding/** @ledgerhq/live-devices
**/OnboardingAppInstall/** @ledgerhq/live-devices
**/UpdateFirmwareModal/** @ledgerhq/live-devices
apps/**/components/DeviceAction/ @ledgerhq/live-devices
apps/ledger-live-mobile/src/screens/MyLedger*/ @ledgerhq/live-devices
apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/ @ledgerhq/live-devices
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pnpm mobile pod

### Tools

We use [**pnpm workspaces**](https://pnpm.io/) and [**turborepo**](https://turborepo.org/) under the hood to handle local and external dependencies, orchestrate tasks and perform various optimizations like package hoisting or [**remote caching**](https://turborepo.org/docs/features/remote-caching).
We use [**pnpm workspaces**](https://pnpm.io/) and [**turborepo**](https://turborepo.org/) under the hood to handle local and external dependencies, orchestrate tasks and perform various optimizations like package hoisting or [**remote caching**](https://turbo.build/repo/docs/core-concepts/remote-caching).

For changelog generation releases and package publishing we rely on the [**changesets**](https://github.com/changesets/changesets) library.

Expand Down
Loading

0 comments on commit 26e7b94

Please sign in to comment.