Skip to content

Commit

Permalink
Merge pull request #243 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
merge to master
  • Loading branch information
cedelavergne-ledger authored Dec 19, 2024
2 parents 4f2253b + 50e2c39 commit d9e333e
Show file tree
Hide file tree
Showing 7,092 changed files with 4,597 additions and 1,861 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
- [ ] Target branch is `develop` <!-- unless you have a very good reason -->
- [ ] Application version has been bumped <!-- required if your changes are to be deployed -->

<!-- Make sure you followed the process described in https://developers.ledger.com/docs/embedded-app/maintenance/ before opening your Pull Request.
<!-- Make sure you followed the process described in https://developers.ledger.com/docs/device-app/deliver/maintenance before opening your Pull Request.
Don't hesitate to contact us directly on Discord if you have any questions ! https://developers.ledger.com/discord -->
2 changes: 1 addition & 1 deletion .github/workflows/check_protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: Compilation & tests

on:
workflow_dispatch:
inputs:
golden_run:
type: choice
required: true
default: 'Raise an error (default)'
description: CI behavior if the test snaphots are different than expected.
options:
- 'Raise an error (default)'
- 'Open a PR'
push:
branches:
- master
Expand All @@ -10,6 +19,8 @@ on:

jobs:
job_swap_functional_tests:
name: Build and test
uses: ./.github/workflows/reusable_swap_functional_tests.yml
with:
branch_for_exchange: ${{ github.ref }}
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ on:
pull_request:

jobs:
job_lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3

- name: Lint
uses: DoozyX/[email protected]
with:
source: './src'
extensions: 'h,c'
clangFormatVersion: 12
check_linting:
name: Check linting using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_lint.yml@v1
with:
source: './src'
extensions: 'h,c'
version: 12
2 changes: 1 addition & 1 deletion .github/workflows/misspellings_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check misspellings
uses: codespell-project/actions-codespell@v1
Expand Down
130 changes: 64 additions & 66 deletions .github/workflows/reusable_swap_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ on:
required: false
default: 'develop'
type: string
branch_for_bitcoin_nanos:
required: false
default: 'nanos'
type: string
repo_for_bitcoin:
required: false
default: 'LedgerHQ/app-bitcoin-new'
Expand All @@ -66,6 +70,10 @@ on:
required: false
default: 'develop'
type: string
branch_for_solana_nanos:
required: false
default: 'nanos'
type: string
repo_for_solana:
required: false
default: 'LedgerHQ/app-solana'
Expand All @@ -89,14 +97,37 @@ on:
default: 'LedgerHQ/app-tron'
type: string

branch_for_ton:
required: false
default: 'develop'
type: string
repo_for_ton:
required: false
default: 'LedgerHQ/app-ton-new'
type: string

branch_for_cardano:
required: false
default: 'develop'
type: string
repo_for_cardano:
required: false
default: 'LedgerHQ/app-cardano'
type: string

test_filter:
required: false
default: '""'
type: string
regenerate_snapshots:
description: 'Clean snapshots, regenerate them, commit the changes in a branch, and open a PR'
required: false
default: false
type: boolean

jobs:
build_sideloaded_applications:
name: Build sideloaded applications using the reusable workflow
name: Build libraries
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -125,29 +156,51 @@ jobs:
- name: bitcoin
repo: ${{ inputs.repo_for_bitcoin }}
branch: ${{ inputs.branch_for_bitcoin }}
- name: bitcoin
repo: ${{ inputs.repo_for_bitcoin }}
branch: ${{ inputs.branch_for_bitcoin_nanos }}
- name: solana
repo: ${{ inputs.repo_for_solana }}
branch: ${{ inputs.branch_for_solana }}
- name: bsc
repo: ${{ inputs.repo_for_ethereum }}
branch: ${{ inputs.branch_for_ethereum }}
- name: solana
repo: ${{ inputs.repo_for_solana }}
branch: ${{ inputs.branch_for_solana_nanos }}
- name: DOT
repo: ${{ inputs.repo_for_polkadot }}
branch: ${{ inputs.branch_for_polkadot }}
- name: tron
repo: ${{ inputs.repo_for_tron }}
branch: ${{ inputs.branch_for_tron }}
- name: ton
repo: ${{ inputs.repo_for_ton }}
branch: ${{ inputs.branch_for_ton }}
- name: cardano
repo: ${{ inputs.repo_for_cardano }}
branch: ${{ inputs.branch_for_cardano }}

uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: ${{ matrix.coin.repo }}
app_branch_name: ${{ matrix.coin.branch }}
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }}"
upload_app_binaries_artifact: libraries_binaries
app_branch_name: ${{ matrix.coin.branch }}
# Set the coin variant to build with COIN or CHAIN depending on the app + flags for ETH compilation
# As a rule of thumb we don't care about giving unexisting flags to other apps, it has no effect
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }} CAL_TEST_KEY=1 DOMAIN_NAME_TEST_KEY=1 SET_PLUGIN_TEST_KEY=1 NFT_TEST_KEY=1"
upload_app_binaries_artifact: libraries_binaries-${{ matrix.coin.name }}-${{ strategy.job-index }}
upload_as_lib_artifact: ${{ matrix.coin.name }}

merge_libraries_build:
name: Merge built libraries
needs: build_sideloaded_applications
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: libraries_binaries
pattern: libraries_binaries-*
delete-merged: true

build_exchange_application:
name: Build application using the reusable workflow
name: Build Exchange
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: LedgerHQ/app-exchange
Expand All @@ -156,70 +209,15 @@ jobs:
upload_app_binaries_artifact: exchange_binaries

ragger_tests:
name: Run ragger tests using the reusable workflow
name: Run ragger tests
needs:
- build_exchange_application
- build_sideloaded_applications
- merge_libraries_build
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
app_repository: LedgerHQ/app-exchange
app_branch_name: ${{ inputs.branch_for_exchange }}
download_app_binaries_artifact: exchange_binaries
lib_binaries_artifact: libraries_binaries
test_filter: ${{ inputs.test_filter }}

# Legacy
zemu_tests:
name: Zemu tests
strategy:
matrix:
# device: ["Nano S", "Nano X", "Nano SP"]
device: ["Nano S"]
needs:
- build_exchange_application
- build_sideloaded_applications
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3
with:
repository: LedgerHQ/app-exchange
ref: ${{ inputs.branch_for_exchange }}

- name: Install APT dependencies
run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Yarn
run: npm install -g yarn

- name: Install JS dependencies
run: cd test && yarn install

- name: Download all binaries
uses: actions/download-artifact@v3

- name: Download exchange binaries
uses: actions/download-artifact@v3
with:
name: exchange_binaries
path: ./build/

- name: Download lib binaries
uses: actions/download-artifact@v3
with:
name: libraries_binaries
path: ./test/python/lib_binaries/

- name: Dispatch to the tests/elfs
run: |
./copy_elfs_for_zemu.sh
tree test/elfs
- name: Run zemu tests for device ${{ matrix.device }}
run: cd test && yarn test -t "\[${{ matrix.device }}\]"
regenerate_snapshots: ${{ inputs.regenerate_snapshots }}
Loading

0 comments on commit d9e333e

Please sign in to comment.