Skip to content

Commit 2f54673

Browse files
authored
Merge pull request #28 from Zondax/dev
2 parents 9883877 + 059cf0d commit 2f54673

265 files changed

Lines changed: 27579 additions & 22852 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.

.github/workflows/check_version.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@ jobs:
2020
needs: configure
2121
runs-on: ubuntu-latest
2222
container:
23-
image: zondax/builder-bolos:latest
23+
image: zondax/ledger-app-builder:latest
2424
options: --user ${{ needs.configure.outputs.uid_gid }}
25-
env:
26-
BOLOS_ENV: /opt/bolos
27-
HOME: /home/zondax_circle
2825
outputs:
2926
version: ${{ steps.store-version.outputs.version }}
3027
steps:
3128
- name: Checkout
3229
uses: actions/checkout@v3
3330
with:
3431
submodules: true
35-
36-
- name: Invoke `version`
37-
shell: bash -l {0}
38-
env:
39-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
40-
run: make version
41-
32+
- run: make version
4233
- id: store-version
4334
run: echo "version=$(cat ./app/app.version)" >> $GITHUB_OUTPUT
4435

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "CodeQL"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches:
8+
- main
9+
- develop
10+
11+
jobs:
12+
analyse:
13+
name: Analyse
14+
strategy:
15+
matrix:
16+
sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"]
17+
runs-on: ubuntu-latest
18+
container:
19+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
20+
21+
steps:
22+
- name: Clone
23+
uses: actions/checkout@v3
24+
with:
25+
submodules: recursive
26+
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v2
29+
with:
30+
languages: cpp
31+
queries: security-and-quality
32+
33+
- name: Build
34+
run: |
35+
make -j BOLOS_SDK=${{ matrix.sdk }}
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@v2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Ensure compliance with Ledger guidelines
2+
3+
# This workflow is mandatory in all applications
4+
# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team.
5+
# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger
6+
# application store.
7+
#
8+
# More information on the guidelines can be found in the repository:
9+
# LedgerHQ/ledger-app-workflows/
10+
11+
on:
12+
workflow_dispatch:
13+
push:
14+
branches:
15+
- master
16+
- main
17+
- develop
18+
pull_request:
19+
20+
jobs:
21+
guidelines_enforcer:
22+
name: Call Ledger guidelines_enforcer
23+
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
24+
with:
25+
relative_app_directory: app

.github/workflows/ledger.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 26 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
run: |
2828
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
2929
make deps
30-
- run: cmake -DCMAKE_BUILD_TYPE=Debug . && make
31-
- run: GTEST_COLOR=1 ASAN_OPTIONS=detect_leaks=0 ctest -VV
30+
- run: make cpp_test
3231

3332
build_only_rust:
3433
runs-on: ubuntu-latest
@@ -37,9 +36,10 @@ jobs:
3736
uses: actions/checkout@v3
3837
with:
3938
submodules: true
40-
- name: Install deps
41-
run: |
42-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
39+
- name: Install rust
40+
uses: actions-rs/toolchain@v1
41+
with:
42+
toolchain: stable
4343
- name: rustfmt
4444
run: |
4545
cd ./app/rust
@@ -59,12 +59,10 @@ jobs:
5959
needs: configure
6060
runs-on: ubuntu-latest
6161
container:
62-
image: zondax/builder-bolos:latest
62+
image: zondax/ledger-app-builder:latest
6363
options: --user ${{ needs.configure.outputs.uid_gid }}
64-
env:
65-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
66-
BOLOS_ENV: /opt/bolos
67-
HOME: /home/zondax_circle
64+
env:
65+
BOLOS_SDK: /opt/nanos-secure-sdk
6866
outputs:
6967
size: ${{steps.build.outputs.size}}
7068
steps:
@@ -76,14 +74,12 @@ jobs:
7674
id: build
7775
shell: bash -l {0}
7876
run: |
79-
source $HOME/.cargo/env
8077
SUBSTRATE_PARSER_FULL=1 make
8178
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
8279
- name: Build SR25519 app
8380
shell: bash -l {0}
8481
run: |
85-
source $HOME/.cargo/env
86-
SUPPORT_SR25519=1 make
82+
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make
8783
8884
size_nano_s:
8985
needs: build_ledger
@@ -109,41 +105,27 @@ jobs:
109105
submodules: true
110106
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
111107
- name: Install rust
112-
run: |
113-
sudo apt-get update
114-
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
115-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
108+
uses: actions-rs/toolchain@v1
109+
with:
110+
toolchain: stable
116111
- name: Install node
117112
uses: actions/setup-node@v3
118113
- name: Install yarn
119114
run: |
120115
npm install -g yarn
121-
- name: Build Ledger app
116+
- name: Build and run zemu tests
122117
run: |
123-
make SUBSTRATE_PARSER_FULL=1
124-
- name: Build SR25519 Ledger app
125-
run: |
126-
make clean_build && SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
127-
- name: Build/Install build js deps
128-
run: |
129-
export PATH=~/.cargo/bin:$PATH
130-
make zemu_install
131-
- name: Run zemu tests
132-
run: |
133-
export PATH=~/.cargo/bin:$PATH
134-
make zemu_test
118+
make test_all
135119
136-
build_package_0:
120+
build_package_nanos:
137121
needs: [configure, build, build_ledger, test_zemu]
138122
if: ${{ github.ref == 'refs/heads/main' }}
139123
runs-on: ubuntu-latest
140124
container:
141-
image: zondax/builder-bolos:latest
125+
image: zondax/ledger-app-builder:latest
142126
options: --user ${{ needs.configure.outputs.uid_gid }}
143-
env:
144-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
145-
BOLOS_ENV: /opt/bolos
146-
HOME: /home/zondax_circle
127+
env:
128+
BOLOS_SDK: /opt/nanos-secure-sdk
147129
steps:
148130
- name: Checkout
149131
uses: actions/checkout@v3
@@ -155,7 +137,6 @@ jobs:
155137
- name: Build NanoS
156138
shell: bash -l {0}
157139
run: |
158-
source $HOME/.cargo/env
159140
make SUBSTRATE_PARSER_FULL=0
160141
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
161142
- name: Set tag
@@ -172,17 +153,15 @@ jobs:
172153
draft: false
173154
prerelease: false
174155

175-
build_package_1:
156+
build_package_nanos_xl:
176157
needs: [configure, build, build_ledger, test_zemu]
177158
if: ${{ github.ref == 'refs/heads/main' }}
178159
runs-on: ubuntu-latest
179160
container:
180-
image: zondax/builder-bolos:latest
161+
image: zondax/ledger-app-builder:latest
181162
options: --user ${{ needs.configure.outputs.uid_gid }}
182-
env:
183-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
184-
BOLOS_ENV: /opt/bolos
185-
HOME: /home/zondax_circle
163+
env:
164+
BOLOS_SDK: /opt/nanos-secure-sdk
186165
steps:
187166
- name: Checkout
188167
uses: actions/checkout@v3
@@ -194,7 +173,6 @@ jobs:
194173
- name: Build NanoS XL
195174
shell: bash -l {0}
196175
run: |
197-
source $HOME/.cargo/env
198176
make SUBSTRATE_PARSER_FULL=1
199177
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos_xl.sh
200178
- name: Set tag
@@ -211,17 +189,15 @@ jobs:
211189
draft: false
212190
prerelease: false
213191

214-
build_package_2:
192+
build_package_nanosp:
215193
needs: [configure, build, build_ledger, test_zemu]
216194
if: ${{ github.ref == 'refs/heads/main' }}
217195
runs-on: ubuntu-latest
218196
container:
219-
image: zondax/builder-bolos:latest
197+
image: zondax/ledger-app-builder:latest
220198
options: --user ${{ needs.configure.outputs.uid_gid }}
221-
env:
222-
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
223-
BOLOS_ENV: /opt/bolos
224-
HOME: /home/zondax_circle
199+
env:
200+
BOLOS_SDK: /opt/nanosplus-secure-sdk
225201
steps:
226202
- name: Checkout
227203
uses: actions/checkout@v3
@@ -233,7 +209,6 @@ jobs:
233209
- name: Build NanoSP
234210
shell: bash -l {0}
235211
run: |
236-
source $HOME/.cargo/env
237212
make SUBSTRATE_PARSER_FULL=1
238213
mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh
239214
- name: Set tag

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ tests_zemu/.pnp.*
6666
node_modules
6767
fuzz/corpora
6868

69+
app/build
6970
!build/.gitkeep
7071
build/*
7172
cmake-build-debug

.gitmodules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
url = https://github.com/bilke/cmake-modules.git
1010
[submodule "deps/nanox-secure-sdk"]
1111
path = deps/nanox-secure-sdk
12-
url = https://github.com/LedgerHQ/nanox-secure-sdk.git
12+
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
1313
[submodule "deps/nanosplus-secure-sdk"]
1414
path = deps/nanosplus-secure-sdk
15-
url = https://github.com/LedgerHQ/nanosplus-secure-sdk.git
15+
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
1616
[submodule "deps/ledger-zxlib"]
1717
path = deps/ledger-zxlib
1818
url = https://github.com/zondax/ledger-zxlib
19+
[submodule "deps/stax-secure-sdk"]
20+
path = deps/stax-secure-sdk
21+
url = https://github.com/LedgerHQ/ledger-secure-sdk.git

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ifeq ($(BOLOS_SDK),)
2525
# In this case, there is not predefined SDK and we run dockerized
2626
# When not using the SDK, we override and build the XL complete app
2727

28+
ZXLIB_COMPILE_STAX ?= 1
2829
SUBSTRATE_PARSER_FULL ?= 1
2930
include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk
3031

@@ -47,5 +48,6 @@ zemu_install: tests_tools_build
4748
test_all:
4849
make zemu_install
4950
SUBSTRATE_PARSER_FULL=1 make
50-
make clean_build && SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
51+
make clean_glyphs
52+
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
5153
make zemu_test

0 commit comments

Comments
 (0)