Skip to content

refactor: canton onboard desktop #24857

refactor: canton onboard desktop

refactor: canton onboard desktop #24857

name: "[Coin] - Coin Tester - Scheduled"
on:
schedule:
- cron: "9 16 * * 1-5"
pull_request:
branches-ignore:
- "smartling-content-updated**"
- "smartling-translation-completed**"
workflow_dispatch:
inputs:
chain:
description: "Coin family to test, separated by commas (,)"
required: false
default: ""
permissions:
id-token: write
contents: read
env:
COIN_TESTER_CURRENCIES: "evm polkadot solana bitcoin"
jobs:
is-affected:
runs-on: ubuntu-22.04
outputs:
is-affected: ${{ steps.detect.outputs.is-affected }}
matrix: ${{ steps.detect.outputs.matrix }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: develop
fetch-depth: 0
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: Checkout push/ref
if: ${{ github.event_name != 'pull_request' }}
run: git checkout $GITHUB_SHA
- name: Run live-common-affected
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^' }}
- name: Build matrix from affected paths or manual input
id: detect
run: |
CHAINS=()
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.chain }}" != "" ]]; then
IFS=',' read -ra CHAINS <<< "${{ github.event.inputs.chain }}"
elif echo "${{ steps.affected.outputs.paths }}" | grep -qE "(^|/| )coin-tester(/| |$)"; then
echo "Detected base coin-tester → adding all coins"
for coin in $COIN_TESTER_CURRENCIES; do
CHAINS+=("$coin")
done
else
# Otherwise, only add coins that appear individually
for coin in $COIN_TESTER_CURRENCIES; do
if echo "${{ steps.affected.outputs.paths }}" | grep -q "$coin"; then
CHAINS+=("$coin")
fi
done
fi
# If it's a scheduled job and no chain is detected, run all chains by default
if [ "${{ github.event_name }}" == "schedule" ] && [ ${#CHAINS[@]} -eq 0 ]; then
for coin in $COIN_TESTER_CURRENCIES; do
CHAINS+=("$coin")
done
CHAIN_JSON=$(printf '%s\n' "${CHAINS[@]}" | jq -R . | jq -cs '{chain: .}')
echo "matrix=${CHAIN_JSON}" >> "$GITHUB_OUTPUT"
echo "is-affected=true" >> $GITHUB_OUTPUT
elif [ ${#CHAINS[@]} -eq 0 ]; then
echo "matrix={\"chain\":[]}" >> $GITHUB_OUTPUT
echo "is-affected=false" >> $GITHUB_OUTPUT
else
CHAIN_JSON=$(printf '%s\n' "${CHAINS[@]}" | jq -R . | jq -cs '{chain: .}')
echo "matrix=${CHAIN_JSON}" >> $GITHUB_OUTPUT
echo "is-affected=true" >> $GITHUB_OUTPUT
fi
- name: Debug affected paths (for troubleshooting)
run: |
echo "Affected paths: ${{ steps.affected.outputs.paths }}"
echo "Is affected: ${{ steps.detect.outputs.is-affected }}"
echo "Matrix: ${{ steps.detect.outputs.matrix }}"
coin-tester:
name: Coin Tester - ${{ matrix.chain }}
needs: is-affected
if: ${{ needs.is-affected.outputs.is-affected == 'true' }}
runs-on: public-ledgerhq-shared-small
continue-on-error: true
strategy:
matrix:
chain: ${{ fromJson(needs.is-affected.outputs.matrix).chain }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
with:
install-proto: true
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- name: Login to Ledger Artifactory
id: jfrog-login
timeout-minutes: 10
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
- name: Login to JFrog OCI Registry
uses: docker/login-action@v3
with:
registry: jfrog.ledgerlabs.net/bbs-oci-prod-green
username: ${{ steps.jfrog-login.outputs.oidc-user }}
password: ${{ steps.jfrog-login.outputs.oidc-token }}
- name: Setup environment
uses: ./tools/actions/composites/setup-coin-tester-env
- name: Run Coin Tester
uses: ./tools/actions/composites/run-coin-tester
with:
chain: ${{ matrix.chain }}