Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…aytn into develop
  • Loading branch information
n4l5u0r committed Mar 6, 2024
2 parents 765b3e2 + 05f18b5 commit bf3719a
Show file tree
Hide file tree
Showing 377 changed files with 526 additions and 12,566 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ SortIncludes: false
SpaceAfterCStyleCast: true
AllowShortCaseLabelsOnASingleLine: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
Expand Down
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 -->
32 changes: 32 additions & 0 deletions .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and run functional tests using ragger through reusable workflow

# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the
# resulting binaries.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
#
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and
# tooling environment is meant to be easy to use and adapt after forking your application

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

jobs:
build_application:
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_binaries"

ragger_tests:
name: Run ragger tests using the reusable workflow
needs: build_application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
download_app_binaries_artifact: "compiled_app_binaries"
106 changes: 0 additions & 106 deletions .github/workflows/ci-workflow.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ __pycache__
.pyc
*~
opt
tests/elfs/*
tests/elfs
tests/snapshots-tmp/
.DS_Store
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

104 changes: 57 additions & 47 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,59 @@
{
"env": {
"BOLOS_SDK": "/opt/nanosp-secure-sdk",
"BOLOS_ENV": "/opt/bolos-devenv"
},
"configurations": [
{
"name": "Nano S Plus",
"includePath": [
"/usr/include",
"${workspaceFolder}/src",
"${env:BOLOS_SDK}/include/*",
"${env:BOLOS_SDK}/lib_ux/include/*"
],
"defines": [
"TARGET_NANOSP",
"OS_IO_SEPROXYHAL",
"HAVE_BAGL",
"HAVE_SPRINTF",
"HAVE_IO_USB",
"HAVE_L4_USBLIB",
"IO_USB_MAX_ENDPOINTS=6",
"IO_HID_EP_LENGTH=64",
"HAVE_USB_APDU",
"USB_SEGMENT_SIZE=64",
"UNUSED(x)=(void)x",
"APPVERSION=\"1.0.0\"",
"APPNAME=\"Boilerplate\"",
"MAJOR_VERSION=1",
"MINOR_VERSION=0",
"PATCH_VERSION=0",
"IO_SEPROXYHAL_BUFFER_SIZE_B=300",
"HAVE_UX_FLOW",
"DEBUG=1",
"HAVE_PRINTF",
"PRINTF=screen_printf"
],
"compilerPath": "${env:BOLOS_ENV}/gcc-arm-none-eabi-5_3-2016q1/bin/arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-arm",
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
"env": {
"BOLOS_SDK": "/opt/nanosp-secure-sdk",
"BOLOS_ENV": "/opt/bolos-devenv"
},
"configurations": [
{
"name": "Nano S Plus",
"includePath": [
"/usr/include",
"${workspaceFolder}/src",
"${env:BOLOS_SDK}/include/*",
"${env:BOLOS_SDK}/lib_ux/include/*",
"${workspaceFolder}/opt/ledger-secure-sdk/include",
"${workspaceFolder}/opt/ledger-secure-sdk/target/nanos2/include",
"${workspaceFolder}/opt/ledger-secure-sdk/lib_cxng/include",
"${workspaceFolder}/opt/ledger-secure-sdk/lib_ux/include",
"${workspaceFolder}/opt/ledger-secure-sdk/lib_bagl/include",
"${workspaceFolder}/opt/ledger-secure-sdk/unit-tests/lib_nbgl",
"${workspaceFolder}/lib/include"
],
"defines": [
"TARGET_NANOSP",
"OS_IO_SEPROXYHAL",
"HAVE_BAGL",
"HAVE_SPRINTF",
"HAVE_IO_USB",
"HAVE_L4_USBLIB",
"IO_USB_MAX_ENDPOINTS=6",
"IO_HID_EP_LENGTH=64",
"HAVE_USB_APDU",
"USB_SEGMENT_SIZE=64",
"UNUSED(x)=(void)x",
"APPVERSION=\"1.0.0\"",
"APPNAME=\"Boilerplate\"",
"MAJOR_VERSION=1",
"MINOR_VERSION=0",
"PATCH_VERSION=0",
"IO_SEPROXYHAL_BUFFER_SIZE_B=300",
"HAVE_UX_FLOW",
"DEBUG=1",
"HAVE_PRINTF",
"PRINTF=screen_printf",
"HAVE_SHA3=1",
"HAVE_HASH=1",
"HAVE_ECC=1"
],
"compilerPath": "${env:BOLOS_ENV}/gcc-arm-none-eabi-5_3-2016q1/bin/arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-arm",
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
27 changes: 11 additions & 16 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"label": "Build app [debug]",
"type": "shell",
// Builds the app with debug mode enabled using the make command, inside the docker container.
"command": "docker exec -it ${config:container_name} bash -c 'export BOLOS_SDK=$(echo ${input:sdk}) && make -j DEBUG=1'",
"command": "docker exec -it ${config:container_name} bash -c 'export BOLOS_SDK=$(echo ${input:sdk}) && make -j DEBUG=1' && cp bin/app.elf tests/elfs/klaytn_${input:model}.elf",
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -74,7 +74,7 @@
"label": "Generate screenshots to validate test (golden run)",
"type": "shell",
// Runs functional tests inside the docker container (with Qt display disabled) and save screenshots.
"command": "docker exec -it ${config:container_name} bash -c 'pytest tests/python/ --tb=short -v --device ${input:model} --golden_run'",
"command": "docker exec -it ${config:container_name} bash -c 'pytest tests/ --tb=short -v --device ${input:model} --golden_run'",
"group": {
"kind": "test",
"isDefault": true
Expand All @@ -85,31 +85,29 @@
"label": "Run functional tests (without logs)",
"type": "shell",
// Runs functional tests inside the docker container (with Qt display disabled).
"command": "docker exec -it ${config:container_name} bash -c 'pytest tests/python/ --tb=short -v --device ${input:model}'",
"command": "docker exec -it ${config:container_name} bash -c 'pytest tests/ --tb=short -v --device ${input:model}'",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"dependsOn": [
"Install tests requirements",
"Copy app.elf from bin to test/elfs directory"

]
},
{
"label": "Run functional tests (with logs)",
"type": "shell",
// Runs functional tests inside the docker container (with Qt display disabled).
"command": "docker exec -it ${config:container_name} bash -c 'pytest -s tests/python/ --tb=short -v --device ${input:model}'",
"command": "docker exec -it ${config:container_name} bash -c 'pytest -s tests/ --tb=short -v --device ${input:model}'",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"dependsOn": [
"Install tests requirements",
"Copy app.elf from bin to test/elfs directory"
"Install tests requirements"
]
},
{
Expand Down Expand Up @@ -165,7 +163,7 @@
"label": "Install tests requirements",
"type": "shell",
// Installs functional tests python requirements in the docker container.
"command":"docker exec -it -u 0 ${config:container_name} bash -c 'apk add gcc musl-dev python3-dev && pip install -r tests/python/requirements.txt'",
"command":"docker exec -it -u 0 ${config:container_name} bash -c 'apk add gcc musl-dev python3-dev && pip install -r tests/requirements.txt'",
"group": {
"kind": "test",
"isDefault": true
Expand Down Expand Up @@ -197,26 +195,23 @@
],
"inputs": [
{
"id" : "sdk",
"id" : "sdk",
"type": "pickString",
"description": "Choose a SDK to build with",
"options": [

"$NANOS_SDK",
"$NANOSP_SDK",
"$NANOX_SDK",
"$STAX_SDK",
"$NANOS_SDK",
"$NANOX_SDK"
]
},
{
"id" : "model",
"type": "pickString",
"description": "Which model to run speculos for ?",
"options": [
"nanos",
"nanosp",
"nanox",
"stax",
"nanos",
"nanox"
]
}
]
Expand Down
Loading

0 comments on commit bf3719a

Please sign in to comment.