Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 7528ce8

Browse files
authored
Merge pull request #190 from Zondax/update-9380
2 parents f0a8bfa + 5d128a7 commit 7528ce8

File tree

113 files changed

+85681
-63926
lines changed

Some content is hidden

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

113 files changed

+85681
-63926
lines changed

.github/workflows/check_version.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,18 @@ 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 }}
2525
env:
26-
BOLOS_ENV: /opt/bolos
27-
HOME: /home/zondax_circle
26+
SDK_VARNAME: NANOSP_SDK
2827
outputs:
2928
version: ${{ steps.store-version.outputs.version }}
3029
steps:
3130
- name: Checkout
3231
uses: actions/checkout@v3
3332
with:
3433
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-
34+
- run: make version
4235
- id: store-version
4336
run: echo "version=$(cat ./app/app.version)" >> $GITHUB_OUTPUT
4437

.github/workflows/main.yml

+28-80
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,68 +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;
116-
- name: Install node
117-
uses: actions/setup-node@v3
118-
- name: Install yarn
119-
run: |
120-
npm install -g yarn
121-
- name: Build Ledger app
122-
run: |
123-
make SUBSTRATE_PARSER_FULL=1
124-
- name: Build/Install build js deps
125-
run: |
126-
export PATH=~/.cargo/bin:$PATH
127-
make zemu_install
128-
- name: Run zemu tests
129-
run: |
130-
export PATH=~/.cargo/bin:$PATH
131-
make zemu_test
132-
133-
test_zemu_sr25519:
134-
runs-on: ubuntu-latest
135-
steps:
136-
- name: Checkout
137-
uses: actions/checkout@v3
108+
uses: actions-rs/toolchain@v1
138109
with:
139-
submodules: true
140-
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
141-
- name: Install rust
142-
run: |
143-
sudo apt-get update
144-
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
145-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
110+
toolchain: stable
146111
- name: Install node
147112
uses: actions/setup-node@v3
148113
- name: Install yarn
149114
run: |
150115
npm install -g yarn
151-
- name: Build Ledger app
152-
run: |
153-
make clean_build && SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
154-
- name: Build/Install build js deps
155-
run: |
156-
export PATH=~/.cargo/bin:$PATH
157-
make zemu_install
158-
- name: Run zemu tests for sr25519
116+
- name: Build and run zemu tests
159117
run: |
160-
export PATH=~/.cargo/bin:$PATH
161-
cd tests_zemu && yarn testSR25519
118+
make test_all
162119
163-
build_package_0:
164-
needs: [configure, build, build_ledger, test_zemu, test_zemu_sr25519]
120+
build_package_nanos:
121+
needs: [configure, build, build_ledger, test_zemu]
165122
if: ${{ github.ref == 'refs/heads/main' }}
166123
runs-on: ubuntu-latest
167124
container:
168-
image: zondax/builder-bolos:latest
125+
image: zondax/ledger-app-builder:latest
169126
options: --user ${{ needs.configure.outputs.uid_gid }}
170-
env:
171-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
172-
BOLOS_ENV: /opt/bolos
173-
HOME: /home/zondax_circle
127+
env:
128+
BOLOS_SDK: /opt/nanos-secure-sdk
174129
steps:
175130
- name: Checkout
176131
uses: actions/checkout@v3
@@ -182,7 +137,6 @@ jobs:
182137
- name: Build NanoS
183138
shell: bash -l {0}
184139
run: |
185-
source $HOME/.cargo/env
186140
make SUBSTRATE_PARSER_FULL=0
187141
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
188142
- name: Set tag
@@ -199,17 +153,15 @@ jobs:
199153
draft: false
200154
prerelease: false
201155

202-
build_package_1:
203-
needs: [configure, build, build_ledger, test_zemu, test_zemu_sr25519]
156+
build_package_nanos_xl:
157+
needs: [configure, build, build_ledger, test_zemu]
204158
if: ${{ github.ref == 'refs/heads/main' }}
205159
runs-on: ubuntu-latest
206160
container:
207-
image: zondax/builder-bolos:latest
161+
image: zondax/ledger-app-builder:latest
208162
options: --user ${{ needs.configure.outputs.uid_gid }}
209-
env:
210-
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
211-
BOLOS_ENV: /opt/bolos
212-
HOME: /home/zondax_circle
163+
env:
164+
BOLOS_SDK: /opt/nanos-secure-sdk
213165
steps:
214166
- name: Checkout
215167
uses: actions/checkout@v3
@@ -221,7 +173,6 @@ jobs:
221173
- name: Build NanoS XL
222174
shell: bash -l {0}
223175
run: |
224-
source $HOME/.cargo/env
225176
make SUBSTRATE_PARSER_FULL=1
226177
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos_xl.sh
227178
- name: Set tag
@@ -238,17 +189,15 @@ jobs:
238189
draft: false
239190
prerelease: false
240191

241-
build_package_2:
242-
needs: [configure, build, build_ledger, test_zemu, test_zemu_sr25519]
192+
build_package_nanosp:
193+
needs: [configure, build, build_ledger, test_zemu]
243194
if: ${{ github.ref == 'refs/heads/main' }}
244195
runs-on: ubuntu-latest
245196
container:
246-
image: zondax/builder-bolos:latest
197+
image: zondax/ledger-app-builder:latest
247198
options: --user ${{ needs.configure.outputs.uid_gid }}
248-
env:
249-
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
250-
BOLOS_ENV: /opt/bolos
251-
HOME: /home/zondax_circle
199+
env:
200+
BOLOS_SDK: /opt/nanosplus-secure-sdk
252201
steps:
253202
- name: Checkout
254203
uses: actions/checkout@v3
@@ -260,7 +209,6 @@ jobs:
260209
- name: Build NanoSP
261210
shell: bash -l {0}
262211
run: |
263-
source $HOME/.cargo/env
264212
make SUBSTRATE_PARSER_FULL=1
265213
mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh
266214
- name: Set tag

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ fuzz/corpora
6969
!build/.gitkeep
7070
build/*
7171
cmake-build-debug
72+
app/build
7273

7374
tests_zemu/snapshots-tmp
7475
tests_zemu/yarn.lock

.gitmodules

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
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
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

Makefile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#*******************************************************************************
2-
#* (c) 2019 Zondax GmbH
2+
#* (c) 2019 - 2023 Zondax AG
33
#*
44
#* Licensed under the Apache License, Version 2.0 (the "License");
55
#* you may not use this file except in compliance with the License.
@@ -46,8 +46,6 @@ zemu_install: tests_tools_build
4646

4747
test_all:
4848
make zemu_install
49-
# test sr25519
50-
make clean_build && SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
51-
cd tests_zemu && yarn testSR25519
52-
make clean_build && SUBSTRATE_PARSER_FULL=1 make
49+
SUBSTRATE_PARSER_FULL=1 make
50+
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
5351
make zemu_test

0 commit comments

Comments
 (0)