Skip to content

Commit 52f49a3

Browse files
committed
update app to latest requirements
1 parent b4893aa commit 52f49a3

1,240 files changed

Lines changed: 25142 additions & 298202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
ColumnLimit: 120
4+
DerivePointerAlignment: false
5+
PointerAlignment: Right

.clang-tidy

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Checks: "-*,
2+
clang-analyzer-*,
3+
clang-diagnostic-*,
4+
cppcoreguidelines-init-variables,
5+
google-readability-avoid-underscore-in-googletest-name,
6+
google-runtime-int,
7+
misc-*,
8+
performance-*,
9+
portability-*,
10+
readability-*,
11+
-misc-no-recursion,
12+
-readability-function-cognitive-complexity
13+
-readability-magic-numbers"
14+
WarningsAsErrors: "*"
15+
CheckOptions:
16+
- key: readability-identifier-length.MinimumVariableNameLength
17+
value: 2
18+
- key: readability-identifier-length.MinimumParameterNameLength
19+
value: 2
20+
- key: readability-identifier-length.MinimumLoopCounterNameLength
21+
value: 1

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Verify PRs to main
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
- develop
9+
- master
10+
- dev
11+
12+
jobs:
13+
configure:
14+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
15+
outputs:
16+
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
17+
steps:
18+
- id: get-user
19+
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT
20+
21+
get_version:
22+
needs: configure
23+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
24+
container:
25+
image: zondax/ledger-app-builder:latest
26+
options: --user ${{ needs.configure.outputs.uid_gid }}
27+
env:
28+
SDK_VARNAME: NANOSP_SDK
29+
BOLOS_SDK: /opt/nanosplus-secure-sdk
30+
outputs:
31+
version: ${{ steps.store-version.outputs.version }}
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
submodules: true
37+
- run: make version
38+
- id: store-version
39+
run: echo "version=$(cat ./app/app.version)" >> $GITHUB_OUTPUT
40+
41+
check_app_version:
42+
needs: get_version
43+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
44+
steps:
45+
- id: checkTag
46+
uses: mukunku/[email protected]
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
tag: ${{ needs.get_version.outputs.version }}
51+
52+
- run: echo ${{ steps.checkTag.outputs.exists }}
53+
54+
- name: Tag exists
55+
if: ${{ steps.checkTag.outputs.exists == 'true' }}
56+
run: exit 1

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "CodeQL"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches:
8+
- main
9+
- develop
10+
- master # for safety reasons
11+
- dev # for safety reasons
12+
13+
jobs:
14+
analyse:
15+
name: Analyse
16+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
17+
if: github.event.repository.private == false
18+
strategy:
19+
matrix:
20+
sdk: ["$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
21+
container:
22+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
23+
24+
steps:
25+
- name: Clone
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: cpp
34+
queries: security-and-quality
35+
36+
- name: Build
37+
run: |
38+
make -j BOLOS_SDK=${{ matrix.sdk }}
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3

.github/workflows/guidelines_enforcer.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ on:
1212
workflow_dispatch:
1313
push:
1414
branches:
15-
- master
1615
- main
1716
- develop
17+
- master # for safety reasons
18+
- dev # for safety reasons
1819
pull_request:
1920

2021
jobs:
2122
guidelines_enforcer:
22-
name: Call Ledger guidelines_enforcer
23+
if: github.event.repository.private == false
24+
name: Call Ledger guidelines enforcer
2325
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1

.github/workflows/lint.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Lint and format 💅
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches:
8+
- main
9+
- develop
10+
- master # for safety reasons
11+
- dev # for safety reasons
12+
13+
jobs:
14+
lint:
15+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
16+
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
- name: Add missing deps
22+
env:
23+
DEBIAN_FRONTEND: noninteractive
24+
run: |
25+
apt-get update
26+
apt-get install -y bear sudo
27+
- name: Generate compilation database
28+
run: bear -- make -j BOLOS_SDK="$NANOSP_SDK"
29+
- name: Setup python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.11"
33+
- name: Lint and format 💅
34+
uses: cpp-linter/cpp-linter-action@v2
35+
id: linter
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
file-annotations: true
40+
files-changed-only: false
41+
ignore: "app/build|cmake|deps|fuzz|tests"
42+
step-summary: true
43+
style: file # uses .clang-format
44+
thread-comments: true
45+
tidy-checks: "" # use only .clang-tidy checks
46+
- name: Fail if errors
47+
if: steps.linter.outputs.checks-failed > 0
48+
run: |
49+
echo "Linter or formatter failed!"
50+
exit 1

0 commit comments

Comments
 (0)