Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kilnfi/app-plugin-kiln
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: LedgerHQ/app-plugin-kiln
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 477 changed files with 10,213 additions and 1,613 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ SortIncludes: false
SpaceAfterCStyleCast: true
AllowShortCaseLabelsOnASingleLine: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
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 -->
16 changes: 16 additions & 0 deletions .github/workflows/check_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Check SDK submodule version

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

jobs:
job_check_SDK:
name: Check Ethereum plugin SDK submodule is up-to-date
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_check_ethereum_sdk.yml@v1
212 changes: 110 additions & 102 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -5,167 +5,175 @@ on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- develop

jobs:
job_build_plugin:
name: Build plugin for NanoS, X and S+
job_build_release_plugin:
name: Build release plugin
strategy:
matrix:
include:
- SDK: "$NANOS_SDK"
name: nanos
- SDK: "$NANOX_SDK"
name: nanox
- SDK: "$NANOSP_SDK"
name: nanosp
- sdk: '$NANOS_SDK'
name: 'nanos'
- sdk: '$NANOX_SDK'
name: 'nanox'
- sdk: '$NANOSP_SDK'
name: 'nanosp'
- sdk: '$STAX_SDK'
name: 'stax'

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

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

- name: Build
run: |
make BOLOS_SDK=${{ matrix.sdk }} -j
job_scan_build:
name: Clang Static Analyzer
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest

steps:
- uses: actions/checkout@v3
with:
repository: LedgerHQ/ethereum-plugin-sdk
path: ethereum-plugin-sdk
ref: ${{ github.base_ref || github.ref_name }}
- name: Build plugin for Nano S
submodules: recursive

- name: Build with Clang Static Analyzer
run: |
make clean
make BOLOS_SDK=${{ matrix.SDK }}
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@v3
if: failure()
with:
name: scan-build
path: scan-build

job_build_plugin_debug:
name: Build DEBUG plugin for NanoS, X and S+ (testing)
job_build_debug_plugin:
name: Build debug plugin
strategy:
matrix:
include:
- SDK: "$NANOS_SDK"
name: nanos
- SDK: "$NANOX_SDK"
name: nanox
- SDK: "$NANOSP_SDK"
name: nanosp
- sdk: '$NANOS_SDK'
name: 'nanos'
- sdk: '$NANOX_SDK'
name: 'nanox'
- sdk: '$NANOSP_SDK'
name: 'nanosp'

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

steps:
- name: Clone
uses: actions/checkout@v2
- name: Clone SDK
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: LedgerHQ/ethereum-plugin-sdk
path: ethereum-plugin-sdk
ref: ${{ github.base_ref || github.ref_name }}
- name: Build plugin for Nano S
submodules: recursive

- name: Build
run: |
make clean
make -j DEBUG=1 BOLOS_SDK=${{ matrix.SDK }}
- name: Move binary to test directory
make DEBUG=1 BOLOS_SDK=${{ matrix.sdk }} -j
- name: Rename binary
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/plugin_${{ matrix.name }}.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
mv bin/app.elf plugin_${{ matrix.name }}.elf
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: tests/elfs/plugin_${{ matrix.name }}.elf
path: plugin_${{ matrix.name }}.elf

job_build_ethereum:
name: Build Ethereum application for Nano S, X and S+ testing
job_build_debug_app:
name: Build debug Ethereum app
strategy:
matrix:
include:
- SDK: "$NANOS_SDK"
name: nanos
- SDK: "$NANOX_SDK"
name: nanox
- SDK: "$NANOSP_SDK"
name: nanosp
- sdk: '$NANOS_SDK'
name: 'nanos'
- sdk: '$NANOX_SDK'
name: 'nanox'
- sdk: '$NANOSP_SDK'
name: 'nanosp'

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

steps:
- name: Checkout app-ethereum
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: LedgerHQ/app-ethereum
ref: master
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
submodules: recursive
- name: Build ethereum

- name: Build
run: |
make clean
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=${{ matrix.SDK }} CHAIN=ethereum
- name: Move binary to test directory
make DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=${{ matrix.sdk }} -j
- name: Rename binary
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/ethereum_${{ matrix.name }}.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
mv bin/app.elf ethereum_${{ matrix.name }}.elf
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: tests/elfs/ethereum_${{ matrix.name }}.elf
path: ethereum_${{ matrix.name }}.elf

jobs-e2e-tests:
name: E2E Tests
needs: [job_build_plugin_debug,job_build_ethereum]
needs: [job_build_debug_plugin, job_build_debug_app]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- sdk: '$NANOS_SDK'
name: 'nanos'
- sdk: '$NANOX_SDK'
name: 'nanox'
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download built binaries
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: binaries
path: tests/elfs/
- name: Check downloaded binaries
run: ls -lh ./tests/elfs
- name: Install system 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@v2
uses: actions/setup-node@v3
with:
node-version: "14.4.0"
node-version: '16.19.0'

- name: Install yarn
run: |
npm install -g yarn
- name: Build/Install build js deps
- name: Install JS deps
run: |
cd tests && yarn install
- name: Run zemu tests
run: |
cd tests && yarn test
job_scan_build:
name: Clang Static Analyzer
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- uses: actions/checkout@v2
- name: Clone SDK
uses: actions/checkout@v2
with:
repository: LedgerHQ/ethereum-plugin-sdk
path: ethereum-plugin-sdk
ref: ${{ github.base_ref || github.ref_name }}
- name: Build with Clang Static Analyzer
- name: Run Zemu tests
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
cd tests && docker pull zondax/builder-zemu:latest && yarn test
- name: Upload snapshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: scan-build
path: scan-build
name: ${{ matrix.name }}-zemu-snapshots
path: tests/snapshots-tmp/
24 changes: 24 additions & 0 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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

15 changes: 7 additions & 8 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Code style check

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

jobs:
job_lint:
@@ -17,11 +16,11 @@ jobs:

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

- name: Lint
uses: DoozyX/clang-format-lint-action@v0.11
uses: DoozyX/clang-format-lint-action@v0.15
with:
source: "./"
extensions: "h,c"
clangFormatVersion: 10
clangFormatVersion: 12.0.1
18 changes: 18 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Release build

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

jobs:
build:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "compiled_app_bindaries"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ bin/
debug/
dep/
obj/
tests/elfs/
build/

# Editors
.idea/
Loading