Skip to content

[LWDM] A key error occurs for accounts that are already delegated #75651

[LWDM] A key error occurs for accounts that are already delegated

[LWDM] A key error occurs for accounts that are already delegated #75651

name: "[Common] - Integration - PR"
on:
pull_request:
branches-ignore:
- "smartling-content-updated**"
- "smartling-translation-completed**"
concurrency:
group: ci-integration-${{ github.ref }}
permissions:
id-token: write
contents: read
jobs:
is-affected:
outputs:
is-affected: ${{ steps.affected.outputs.is-affected }}
paths: ${{ steps.affected.outputs.paths }}
coins: ${{ steps.affected.outputs.coins }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: develop
fetch-depth: 0
- name: checkout branch (PR)
if: ${{ github.event_name == 'pull_request' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: checkout branch (not PR)
if: ${{ github.event_name != 'pull_request' }}
run: |
git checkout $GITHUB_SHA
- uses: LedgerHQ/ledger-live/tools/actions/live-common-affected@develop
id: affected
with:
ref: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.event.pull_request.base.ref) || 'HEAD^' }}
integration-tests:
name: "Integration Tests"
needs: is-affected
if: ${{ needs.is-affected.outputs.is-affected == 'true' }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
CI_OS: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-14
- windows-2022
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
id: setup-caches
with:
use-mise: true
gh-token: ${{ secrets.GITHUB_TOKEN }}
cache-develop-role-arn: ${{ secrets.AWS_CACHE_OIDC_ROLE_ARN_DEVELOP }}
cache-branch-role-arn: ${{ secrets.AWS_CACHE_OIDC_ROLE_ARN_BRANCH }}
nx-key: ${{ secrets.NX_KEY }}
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
- name: Install dependencies
run: pnpm i --filter="live-common..." --filter="ledger-live" --filter="@ledgerhq/ledger-wallet-framework"
# Seed the local nx cache for live-common's transitive deps in two
# chunks. Each chunk runs in its own nx process so the per-task fd burst
# inside @nx/s3-cache's createPack() stays under the Windows ceiling.
# Smaller libs are safe to go through nx; only live-common (built below)
# is too large for a single createPack call.
- name: Warm cache (Windows)
if: matrix.os == 'windows-2022'
shell: bash
env:
NX_DAEMON: "false"
run: |
set -euo pipefail
pnpm exec nx graph --focus=@ledgerhq/live-common --file=live-common-graph.json
node tools/nx/print-build-dep-chunks.mjs live-common-graph.json @ledgerhq/live-common 2 > warm-chunks.txt
echo "Warming $(wc -l < warm-chunks.txt) chunks for @ledgerhq/live-common"
while IFS= read -r chunk; do
[ -z "$chunk" ] && continue
echo "::group::Warming chunk: $chunk"
pnpm exec nx run-many -t build -p "$chunk" --parallel=1
echo "::endgroup::"
done < warm-chunks.txt
# live-common emits ~8k cached files. This results in an EMFILE in windows. Skip NX for this step on windows
- name: Build (Windows — bypass nx cache write)
if: matrix.os == 'windows-2022'
shell: bash
run: pnpm --filter @ledgerhq/live-common run build
- name: Build
if: matrix.os != 'windows-2022'
run: pnpm exec nx run @ledgerhq/live-common:build
- name: Test
shell: bash
env:
COINS: ${{ needs.is-affected.outputs.coins }}
VERBOSE_FILE: logs.txt
run: |
for COIN in $COINS; do
echo "families/$COIN" | xargs pnpm common ci-test-integration
git diff --exit-code libs/ledger-live-common/src
done
- name: Test Ledger Wallet framework
shell: bash
if: ${{ contains(needs.is-affected.outputs.paths, 'ledger-wallet-framework/') }}
run: pnpm --filter @ledgerhq/ledger-wallet-framework test-integ
- name: (On Failure) Upload live-common snapshots and source
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: ${{ format('live-common-src-{0}', matrix.os) }}
path: |
libs/ledger-live-common/src
- name: (On Failure) Upload logs
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: logs.txt
path: logs.txt