Skip to content

Commit

Permalink
Merge branch develop into master, making master identical to develop.…
Browse files Browse the repository at this point in the history
… Ignore cherry picks made into master
  • Loading branch information
fbeutin-ledger committed May 29, 2024
2 parents b7b8683 + 3d5896b commit c14175a
Show file tree
Hide file tree
Showing 1,832 changed files with 2,357 additions and 6,349 deletions.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Checklist
<!-- Put an `x` in each box when you have completed the items. -->
- [ ] App update process has been followed <!-- See comment below -->
- [ ] 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/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 -->
78 changes: 15 additions & 63 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,17 @@ on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
branches:
- develop

jobs:
build_debug_app:
name: Build debug app
runs-on: ubuntu-latest
strategy:
matrix:
device:
- path: $NANOS_SDK
name: nanos
- path: $NANOX_SDK
name: nanox
- path: $NANOSP_SDK
name: nanosp
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder
steps:
- name: Clone
uses: actions/checkout@v3

- name: Build for ${{ matrix.device.name }}
run: |
make BOLOS_SDK=${{ matrix.device.path }} DEBUG=1
- name: Upload app binary
uses: actions/upload-artifact@v2
with:
name: stellar-app-${{ matrix.device.name }}-debug
path: bin

scan_build:
name: Clang Static Analyzer
runs-on: ubuntu-latest
needs: build_debug_app

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder

steps:
- uses: actions/checkout@v3

- name: Build with Clang Static Analyzer
run: |
make clean
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
- uses: actions/upload-artifact@v2
if: failure()
with:
name: scan-build
path: scan-build
build_application:
name: Build application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: compiled_app_binaries

unit_tests:
name: Unit test
Expand Down Expand Up @@ -87,7 +44,7 @@ jobs:
lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/tests_unit/*' -o coverage.info && \
genhtml coverage.info -o coverage
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: code-coverage
path: tests_unit/coverage
Expand All @@ -105,11 +62,10 @@ jobs:
name: Stellar e2e tests
strategy:
matrix:
device: ["nanos", "nanox", "nanosp"]
device: ["nanos", "nanox", "nanosp", "stax"]
fail-fast: false
needs:
- build_debug_app
- unit_tests
- build_application
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -127,21 +83,17 @@ jobs:
run: cd tests_zemu && npm install

- name: Download app binaries
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: stellar-app-${{ matrix.device }}-debug
path: stellar-app-${{ matrix.device }}-debug

- name: Gather elf
run: |
cp ./stellar-app-${{ matrix.device }}-debug/app.elf ./tests_zemu/elfs/stellar_${{ matrix.device }}.elf
name: compiled_app_binaries
path: build

- name: Run zemu tests
run: cd tests_zemu && npm run test -- -t "\(${{ matrix.device }}\)"

- name: Upload snapshots
if: always()
uses: actions/upload-artifact@v2
if: failure()
uses: actions/upload-artifact@v3
with:
name: zemu-snapshots
name: ${{ matrix.device }}-zemu-snapshots
path: tests_zemu/snapshots-tmp/
23 changes: 23 additions & 0 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ensure compliance with Ledger guidelines

# This workflow is mandatory in all applications
# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team.
# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger
# application store.
#
# More information on the guidelines can be found in the repository:
# LedgerHQ/ledger-app-workflows/

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
5 changes: 2 additions & 3 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
branches:
- develop

jobs:
lint:
Expand All @@ -16,7 +15,7 @@ jobs:

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

- name: Lint
uses: DoozyX/clang-format-lint-action@v0.13
Expand Down
169 changes: 7 additions & 162 deletions .github/workflows/swap-ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,171 +1,16 @@
# https://github.com/LedgerHQ/app-exchange/blob/develop/.github/workflows/ci-workflow.yml
name: Swap function tests
name: Swap functional tests

on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
branches:
- develop


jobs:
build_sideloaded_apps:
strategy:
matrix:
sdk:
- path: $NANOS_SDK
name: nanos
- path: $NANOX_SDK
name: nanox
- path: $NANOSP_SDK
name: nanosp
coin:
- name: tezos
repo: LedgerHQ/app-tezos
branch: develop
- name: xrp
repo: LedgerHQ/app-xrp
branch: develop
- name: ethereum
repo: LedgerHQ/app-ethereum
branch: develop
- name: litecoin
repo: LedgerHQ/app-bitcoin
branch: master
- name: bitcoin_legacy
repo: LedgerHQ/app-bitcoin
branch: master
- name: bitcoin
repo: LedgerHQ/app-bitcoin-new
branch: develop

name: Build App
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder

steps:
- name: Clone ${{ matrix.coin.repo }} for coin ${{ matrix.coin.name }}
uses: actions/checkout@v3
with:
repository: ${{ matrix.coin.repo }}
ref: ${{ matrix.coin.branch }}

- name: Build in ${{ matrix.coin.repo }} coin ${{ matrix.coin.name }} for SDK ${{ matrix.sdk.name }}
run: |
make clean ; make COIN=${{ matrix.coin.name }} BOLOS_SDK=${{ matrix.sdk.path }}
cp bin/app.elf ${{ matrix.coin.name }}_${{ matrix.sdk.name }}.elf
- name: Upload ${{ matrix.coin.name }} binaries
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.coin.name }}_binaries
path: ./*.elf
if-no-files-found: error

build_stellar_app:
strategy:
matrix:
sdk:
- path: $NANOS_SDK
name: nanos
- path: $NANOX_SDK
name: nanox
- path: $NANOSP_SDK
name: nanosp

name: Build Stellar App
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder

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

- name: Build for SDK ${{ matrix.sdk.name }}
run: |
make clean ; make BOLOS_SDK=${{ matrix.sdk.path }}
cp bin/app.elf stellar_${{ matrix.sdk.name }}.elf
- name: Upload stellar binaries
uses: actions/upload-artifact@v2
with:
name: stellar_binaries
path: ./*.elf
if-no-files-found: error

build_exchange:
name: Build Exchange
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [{path: $NANOS_SDK, name: nanos}, {path: $NANOX_SDK, name: nanox}, {path: $NANOSP_SDK, name: nanosp}]

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder

steps:
- name: Clone
uses: actions/checkout@v3
with:
repository: "LedgerHQ/app-exchange"
ref: "develop"
submodules: true

- name: Build Exchange
run: |
make clean ; make BOLOS_SDK=${{ matrix.sdk.path }} TESTING=1 TEST_PUBLIC_KEY=1
cp bin/app.elf exchange_${{ matrix.sdk.name }}.elf
- name: Upload Exchange binaries
uses: actions/upload-artifact@v2
with:
name: exchange_binaries
path: ./*.elf
if-no-files-found: error

e2e_tests:
name: Swap e2e tests
strategy:
matrix:
device: ["Nano S", "Nano X", "Nano SP"]
needs:
- build_exchange
- build_sideloaded_apps
- build_stellar_app
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3
with:
repository: "LedgerHQ/app-exchange"
ref: "develop"

- 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: Upgrade @zondax/zemu
run: cd test && yarn upgrade @zondax/zemu@0.32.0

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

- name: Gather artifacts
run: |
mkdir test/elfs
mv *_binaries/*.elf test/elfs
- name: Run zemu tests for device ${{ matrix.device }}
run: cd test && yarn test -t "\[${{ matrix.device }}\]"
job_functional_tests:
uses: LedgerHQ/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@develop
with:
branch_for_stellar: ${{ github.ref }}
test_filter: '"XLM or xlm or Stellar or stellar"'
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Compilation of Ledger's app
src/glyphs.c
src/glyphs.h
bin/
elfs/
debug/
dep/
obj/
build/
tests_unit/build/
tests_unit/testcases/*.raw
tests_zemu/node_modules/
Expand Down
Loading

0 comments on commit c14175a

Please sign in to comment.