Skip to content

Commit

Permalink
feat: commit initial app code
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Oct 18, 2024
1 parent 9da13d0 commit be92353
Show file tree
Hide file tree
Showing 918 changed files with 101,755 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 125
DerivePointerAlignment: false
PointerAlignment: Right
22 changes: 22 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Checks: "-*,
clang-diagnostic-*,
clang-analyzer-*,
cppcoreguidelines-init-variables,
google-runtime-int,
google-readability-avoid-underscore-in-googletest-name,
misc-*,
performance-*,
portability-*,
readability-*,
-misc-no-recursion,
-readability-function-cognitive-complexity"
WarningsAsErrors: "*"
CheckOptions:
- key: readability-identifier-length.MinimumVariableNameLength
value: 2
- key: readability-identifier-length.MinimumParameterNameLength
value: 2
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 1
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: true
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.{c,h,cpp,hpp}]
indent_style = space
indent_size = 4

[*.{yml,sh}]
indent_style = space
indent_size = 2
55 changes: 55 additions & 0 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Verify PRs to main

on:
workflow_dispatch:
pull_request:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
configure:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT

get_version:
needs: configure
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
SDK_VARNAME: NANOSP_SDK
outputs:
version: ${{ steps.store-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- run: make version
- id: store-version
run: echo "version=$(cat ./app/app.version)" >> $GITHUB_OUTPUT

check_app_version:
needs: get_version
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
steps:
- id: checkTag
uses: mukunku/tag-exists-action@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ needs.get_version.outputs.version }}

- run: echo ${{ steps.checkTag.outputs.exists }}

- name: Tag exists
if: ${{ steps.checkTag.outputs.exists == 'true' }}
run: exit 1
40 changes: 40 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "CodeQL"

on:
workflow_dispatch:
push:
pull_request:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
analyse:
name: Analyse
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
if: github.event.repository.private == false
strategy:
matrix:
sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality

- name: Build
run: |
make -j BOLOS_SDK=${{ matrix.sdk }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
25 changes: 25 additions & 0 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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:
- main
- develop
- master # for safety reasons
- dev # for safety reasons
pull_request:

jobs:
guidelines_enforcer:
if: github.event.repository.private == false
name: Call Ledger guidelines enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
43 changes: 43 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint and format 💅

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

jobs:
lint:
runs-on: ubuntu-latest
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add missing deps
run: |
DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y bear sudo
- name: Generate compilation database
run: bear -- make -j BOLOS_SDK="$NANOSP_SDK"
- name: Lint and format 💅
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file-annotations: true
files-changed-only: false
ignore: "app/build|cmake|deps|fuzz|tests"
step-summary: true
style: file # uses .clang-format
thread-comments: true
tidy-checks: "" # use only .clang-tidy checks
- name: Fail if errors
if: steps.linter.outputs.checks-failed > 0
run: |
echo "Linter or formatter failed!"
exit 1
Loading

0 comments on commit be92353

Please sign in to comment.