Skip to content

Commit

Permalink
Merge branch 'main' into pr-ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Nov 27, 2024
2 parents f829d7a + febc986 commit 6b236ea
Show file tree
Hide file tree
Showing 211 changed files with 45,659 additions and 83,483 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ on:
jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
192 changes: 120 additions & 72 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
submodules: true
- name: Install deps
run: |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
python -m venv venv
source venv/bin/activate
make deps
- run: make cpp_test

Expand Down Expand Up @@ -57,7 +58,39 @@ jobs:
cd ./app/rust
cargo test
build_ledger:
test_zemu:
runs-on: ubuntu-latest
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install node
uses: actions/setup-node@v4
- name: Install yarn
run: |
npm install -g yarn
- name: Build and run zemu tests
run: |
make test_all
- name: Upload Snapshots (only failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: snapshots-tmp
path: tests_zemu/snapshots-tmp/

build_ledger_light:
needs: configure
runs-on: ubuntu-latest
container:
Expand All @@ -72,55 +105,29 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Build Standard app
- name: Build Light app
id: build
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=1 make
SUBSTRATE_PARSER_FULL=0 make
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
- name: Build SR25519 app
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make
SUBSTRATE_PARSER_FULL=0 SUPPORT_SR25519=1 make
size_nano_s:
needs: build_ledger
needs: build_ledger_light
runs-on: ubuntu-latest
env:
NANOS_LIMIT_SIZE: 136
steps:
- run: |
echo "LNS app size: ${{needs.build_ledger.outputs.size}} KiB"
[ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ]
test_zemu:
runs-on: ubuntu-latest
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install node
uses: actions/setup-node@v4
- name: Install yarn
run: |
npm install -g yarn
- name: Build and run zemu tests
run: |
make test_all
echo "LNS app size: ${{needs.build_ledger_light.outputs.size}} KiB"
[ ${{needs.build_ledger_light.outputs.size}} -le $NANOS_LIMIT_SIZE ]
build_package_nanos:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -155,44 +162,85 @@ jobs:
draft: false
prerelease: false

build_package_nanos_xl:
needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/nanos-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install deps
run: pip install ledgerblue

- name: Build NanoS XL
shell: bash -l {0}
run: |
make SUBSTRATE_PARSER_FULL=1 PRODUCTION_BUILD=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos_xl.sh
- name: Set tag
id: nanos_xl
run: echo "tag_name=$(./app/pkg/installer_nanos_xl.sh version)" >> $GITHUB_OUTPUT
- name: Update Release
id: update_release_1
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
files: ./app/pkg/installer_nanos_xl.sh
tag_name: ${{ steps.nanos_xl.outputs.tag_name }}
draft: false
prerelease: false
# Comment out nanoS XL build, the device is not supported anymore due to the size limit.
# The github workflow for the latest supported version is running in nanos.yml

# build_ledger_xl:
# needs: configure
# runs-on: ubuntu-latest
# container:
# image: zondax/ledger-app-builder:latest
# options: --user ${{ needs.configure.outputs.uid_gid }}
# env:
# BOLOS_SDK: /opt/nanos-secure-sdk
# outputs:
# size: ${{steps.build.outputs.size}}
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Build XL app
# id: build
# shell: bash -l {0}
# run: |
# SUBSTRATE_PARSER_FULL=1 make
# echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
# - name: Build SR25519 app
# shell: bash -l {0}
# run: |
# SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make
#
#
# size_nano_s_xl:
# needs: build_ledger_xl
# runs-on: ubuntu-latest
# env:
# NANOS_LIMIT_SIZE: 136
# steps:
# - run: |
# echo "LNS app size: ${{needs.build_ledger_xl.outputs.size}} KiB"
# [ ${{needs.build_ledger_xl.outputs.size}} -le $NANOS_LIMIT_SIZE ]

# build_package_nanos_xl:
# needs: [configure, build, build_ledger_xl, test_zemu, size_nano_s_xl]
# if: ${{ github.ref == 'refs/heads/main' }}
# runs-on: ubuntu-latest
# container:
# image: zondax/ledger-app-builder:latest
# options: --user ${{ needs.configure.outputs.uid_gid }}
# env:
# BOLOS_SDK: /opt/nanos-secure-sdk
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install deps
# run: pip install ledgerblue
#
# - name: Build NanoS XL
# shell: bash -l {0}
# run: |
# make SUBSTRATE_PARSER_FULL=1 PRODUCTION_BUILD=0
# mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos_xl.sh
# - name: Set tag
# id: nanos_xl
# run: echo "tag_name=$(./app/pkg/installer_nanos_xl.sh version)" >> $GITHUB_OUTPUT
# - name: Update Release
# id: update_release_1
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# files: ./app/pkg/installer_nanos_xl.sh
# tag_name: ${{ steps.nanos_xl.outputs.tag_name }}
# draft: false
# prerelease: false

build_package_nanosp:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -228,7 +276,7 @@ jobs:
prerelease: false

build_package_stax:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -262,7 +310,7 @@ jobs:
prerelease: false

build_package_flex:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ tests_zemu/yarn.lock
tests_tools/target
fuzz-*.log
/scan-build
.venv
15 changes: 3 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
[submodule "deps/ledger-zxlib"]
path = deps/ledger-zxlib
url = https://github.com/zondax/ledger-zxlib
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/nanosplus-secure-sdk"]
path = deps/nanosplus-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/nanox-secure-sdk"]
path = deps/nanox-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/stax-secure-sdk"]
path = deps/stax-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/ledger-secure-sdk"]
path = deps/ledger-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ifeq ($(BOLOS_SDK),)
# In this case, there is not predefined SDK and we run dockerized
# When not using the SDK, we override and build the XL complete app

ZXLIB_COMPILE_STAX ?= 1
SUBSTRATE_PARSER_FULL ?= 1
PRODUCTION_BUILD ?= 1
include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk
Expand Down
Loading

0 comments on commit 6b236ea

Please sign in to comment.