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 Aug 12, 2024
2 parents c41378d + 270a2f0 commit 1f5dfb8
Show file tree
Hide file tree
Showing 1,409 changed files with 81,463 additions and 27,177 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,10 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- 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 }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop

Expand Down Expand Up @@ -97,17 +92,6 @@ jobs:
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-build-desktop@develop
with:
os: ${{ matrix.config.name }}
- name: Retrieving internal assets
uses: actions/checkout@v4
with:
ref: main
repository: LedgerHQ/ledger-live-internal-assets
token: ${{ steps.generate-token.outputs.token }}
path: ledger-live-internal-assets

- name: Replace assets
id: assets
run: pnpm desktop assets:replace

- name: Build the app
id: build-app
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/build-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- 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 }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}
Expand Down Expand Up @@ -74,19 +68,10 @@ jobs:
- name: Get short SHA
id: slug
run: echo "sha8=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Retrieving internal assets
uses: actions/checkout@v4
with:
ref: main
repository: LedgerHQ/ledger-live-internal-assets
token: ${{ steps.generate-token.outputs.token }}
path: ledger-live-internal-assets
- name: make local version
env:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ steps.slug.outputs.sha8 }}
run: cd apps/ledger-live-mobile && npm version $VERSION
- name: Replace assets
run: pnpm mobile assets:replace
- name: build the app
env:
ANDROID_KEYSTORE_PASS: staging
Expand All @@ -111,12 +96,6 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- 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 }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}
Expand All @@ -134,15 +113,6 @@ jobs:
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- name: install dependencies
run: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
- name: Retrieving internal assets
uses: actions/checkout@v4
with:
ref: main
repository: LedgerHQ/ledger-live-internal-assets
token: ${{ steps.generate-token.outputs.token }}
path: ledger-live-internal-assets
- name: Replace assets
run: pnpm mobile assets:replace
- name: bundle ios and android js
run: |
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "feat/DSDK-13125-live-assets",
ref: "main",
workflow_id: "release-desktop.yml",
inputs: {
branch: "main"
Expand All @@ -144,7 +144,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "feat/DSDK-13125-live-assets",
ref: "main",
workflow_id: "release-mobile.yml",
inputs: {
ref: "main"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "feat/DSDK-13125-live-assets",
ref: "main",
workflow_id: "pre-desktop.yml",
inputs: {
ref: "${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }}",
Expand All @@ -131,7 +131,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "feat/DSDK-13125-live-assets",
ref: "main",
workflow_id: "pre-mobile.yml",
inputs: {
ref: "${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }}",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock') }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
id: aws
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID_PROD }}:role/${{ secrets.AWS_CACHE_ROLE_NAME }}
Expand Down
117 changes: 92 additions & 25 deletions .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
description: Ignore test having name pattern (entered in the previous field)
type: boolean
default: false

report_path:
description: Path where you want to store this execution's results
required: false
Expand All @@ -32,6 +31,21 @@ on:
required: false
type: boolean
default: false
export_to_xray:
description: Send tests results to Xray
required: false
type: boolean
default: false
test_execution:
description: "Test Execution ticket ID"
required: false
type: string
default: "B2CQA-2461"
enable_send_test:
description: Enable broadcast
required: false
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }}
Expand All @@ -53,8 +67,7 @@ jobs:
CI_OS: "ubuntu-latest"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.9.5
# DEBUG: "pw:browser*"
# DEBUG_LOGS: 1
ENABLE_BROADCAST_TEST: ${{ inputs.enable_send_test }}
runs-on: [ledger-live-4xlarge]
strategy:
fail-fast: false
Expand All @@ -65,6 +78,17 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Setup broadcast environment variables
id: set-env
run: |
day=$(date +%u)
if [ $day -eq 1 ] || "$ENABLE_BROADCAST_TEST" = "1" ; then
echo "ENABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV
else
echo "DISABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV
fi
- name: Setup caches
id: caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
Expand All @@ -80,7 +104,7 @@ jobs:
skip_ruby: true
install_playwright: true
turborepo-server-port: ${{ steps.caches.outputs.port }}
- name: generate token
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
Expand All @@ -93,41 +117,39 @@ jobs:
repository: LedgerHQ/coin-apps
token: ${{ steps.generate-token.outputs.token }}
path: coin-apps
- name: pull docker image
- name: Pull docker image
run: docker pull ${{ env.SPECULOS_IMAGE_TAG }}
shell: bash
- name: Run playwright tests [Linux => xvfb-run]
id: tests
run: |
export SPECULOS_IMAGE_TAG=${{ env.SPECULOS_IMAGE_TAG }}
export COINAPPS=$PWD/coin-apps
export ENABLE_TRANSACTION_BROADCAST=1
export MOCK=0
if [ "${{ inputs.invert_filter }}" = true ]; then invert_filter="-invert"; fi
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:speculos ${INPUTS_TEST_FILTER:+--grep$invert_filter} "${{ inputs.test_filter }}" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
env:
INPUTS_TEST_FILTER: ${{ inputs.test_filter }}
SEED: ${{ secrets.SEED_QAA_B2C }}
XRAY: ${{ inputs.export_to_xray }}
TEST_EXECUTION: ${{ inputs.test_execution }}
PROJECT_KEY: B2CQA

- name: Upload Allure Results
if: ${{ !cancelled() }}
uses: actions/[email protected]
with:
retention-days: 1
name: allure-results-${{ matrix.shardIndex }}
path: "apps/ledger-live-desktop/allure-results"

- name: Upload playwright test results [On Failure]
- name: Upload Xray Results
if: ${{ !cancelled() && inputs.export_to_xray }}
uses: actions/[email protected]
if: failure() && !cancelled()
with:
name: playwright-results-${{ matrix.shardIndex }}
path: |
apps/ledger-live-desktop/tests/artifacts/test-results
apps/ledger-live-desktop/tests/artifacts/html-report
apps/ledger-live-desktop/tests/artifacts/coverage
apps/ledger-live-desktop/tests/artifacts/videos
apps/ledger-live-desktop/tests/artifacts/logs
apps/ledger-live-desktop/tests/artifacts/*.log
retention-days: 1
name: xray-reports-${{ matrix.shardIndex }}
path: apps/ledger-live-desktop/tests/artifacts/xray/xray-report.json

report-and-notify:
name: "Report and Notify"
Expand Down Expand Up @@ -277,7 +299,6 @@ jobs:
if (${{ !inputs.slack_notif && github.event_name == 'workflow_dispatch' }}) return;
const slackPayload = {
"text": "Ledger Live Desktop tests results on ${{github.ref_name}}",
"attachments": [
{
"color": "${{ env.STATUS_COLOR }}",
Expand All @@ -286,20 +307,13 @@ jobs:
"type": "header",
"text": {
"type": "plain_text",
"text": ":ledger-logo: Ledger Live Desktop tests results on ${{ github.ref_name }}",
"text": ":ledger-logo: Ledger Live Desktop E2E tests results on ${{ github.ref_name }}",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "header",
"text": {
"type": "plain_text",
"text": "E2E Tests"
}
},
{
"type": "section",
"text": {
Expand Down Expand Up @@ -342,3 +356,56 @@ jobs:
payload-file-path: ${{ github.workspace }}/payload-slack-content.json
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_LIVE_CI_BOT_TOKEN }}

upload-to-xray:
name: "Upload to Xray"
runs-on: [ledger-live-medium]
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
needs: e2e-tests-linux
if: ${{ !cancelled() && inputs.export_to_xray }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Download Xray Results
uses: actions/[email protected]
with:
path: "apps/ledger-live-desktop/artifacts/xray"
pattern: xray-reports-*
merge-multiple: false

- name: Extract and Aggregate Xray results
run:
./aggregate-xray-reports.sh

- name: Upload aggregated xray results
uses: actions/[email protected]
with:
name: aggregated-xray-reports
path: "apps/ledger-live-desktop/artifacts/xray/aggregated-xray-reports.json"

- name: Authenticate to Xray
id: authenticate
run: |
response=$(curl -H "Content-Type: application/json" -X POST --data '{"client_id": "${{ secrets.XRAY_CLIENT_ID }}", "client_secret": "${{ secrets.XRAY_CLIENT_SECRET }}"}' ${{ env.XRAY_API_URL }}/authenticate)
echo "xray_token=$response" >> $GITHUB_OUTPUT
- name: Publish merged 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 @apps/ledger-live-desktop/artifacts/xray/aggregated-xray-reports.json \
${{ env.XRAY_API_URL }}/import/execution)
key=$(echo $response | jq -r '.key')
echo "xray_key=$key" >> $GITHUB_OUTPUT
- name: Write Xray report in summary
shell: bash
run: echo "::notice title=Xray report URL::${{ env.JIRA_URL }}/${{ steps.publish-xray.outputs.xray_key }}"
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ libs/ledger-live-common/src/wallet-api/ @ledgerhq/wallet-api
**/wallet-api.spec.ts-snapshots/ @ledgerhq/wallet-api
**/dapp.spec.ts @ledgerhq/wallet-api
libs/test-utils/ @ledgerhq/wallet-api
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
**/SyncOnboarding/** @ledgerhq/live-devices
**/OnboardingAppInstall/** @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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ pnpm i
> Note: multiple postinstall steps will be triggered and fail if the applications prerequisites are not met.
> You can safely ignore the errors if you do not plan to work on those apps.
## Common setup errors

### Out of sync Podfile.lock

You may encounter this error when running `pnpm i`. Try:

```sh
rm -rf ~/.cocoapods/
pnpm clean && pnpm store prune && proto use && pnpm i && pnpm build:llm:deps
pnpm mobile pod
```

> Note: If prompted to run `bundle install` do this in the [ledger-live-mobile](apps/ledger-live-mobile) directory. Restart terminal if the error persists.
## Usage

**Important: All the commands should be run at the root of the monorepo.**
Expand Down
Loading

0 comments on commit 1f5dfb8

Please sign in to comment.