diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index ebc7297e..160eeb36 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -25,11 +25,13 @@ jobs: 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@v3 + uses: actions/checkout@v4 with: submodules: true - run: make version diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c9fd3208..78c4c870 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a0557a1..96ca1265 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,11 +16,11 @@ jobs: - id: get-user run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT - cpp_test: + build: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -29,7 +29,7 @@ jobs: make deps - run: make cpp_test - build_ledger_nano_S: + build_ledger: needs: configure runs-on: ubuntu-latest container: @@ -41,7 +41,7 @@ jobs: size: ${{steps.build.outputs.size}} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Build Standard app @@ -52,93 +52,48 @@ jobs: echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT size_nano_s: - needs: build_ledger_nano_S + needs: build_ledger runs-on: ubuntu-latest env: NANOS_LIMIT_SIZE: 136 steps: - run: | - echo "LNS app size: ${{needs.build_ledger_nano_S.outputs.size}} KiB" - [ ${{needs.build_ledger_nano_S.outputs.size}} -le $NANOS_LIMIT_SIZE ] - - build_ledger_nano_X: - needs: configure - runs-on: ubuntu-latest - container: - image: zondax/ledger-app-builder:latest - options: --user ${{ needs.configure.outputs.uid_gid }} - env: - BOLOS_SDK: /opt/nanox-secure-sdk - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Build Standard app - shell: bash -l {0} - run: make - - build_ledger_nano_SP: - needs: configure - runs-on: ubuntu-latest - container: - image: zondax/ledger-app-builder:latest - options: --user ${{ needs.configure.outputs.uid_gid }} - env: - BOLOS_SDK: /opt/nanosplus-secure-sdk - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Build Standard app - shell: bash -l {0} - run: make - - build_ledger_stax: - needs: configure - runs-on: ubuntu-latest - container: - image: zondax/ledger-app-builder:latest - options: --user ${{ needs.configure.outputs.uid_gid }} - env: - BOLOS_SDK: /opt/stax-secure-sdk - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Build Standard app - shell: bash -l {0} - run: make + 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 - timeout-minutes: 30 steps: + - name: Test + run: | + id + echo $HOME + echo $DISPLAY - name: Checkout - uses: actions/checkout@v3 + 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 node uses: actions/setup-node@v3 - name: Install yarn - run: npm install -g yarn - - name: Build Ledger app and run tests - run: make test_all + run: | + npm install -g yarn + - name: Build Ledger app + run: make + - name: Build/Install build js deps + run: make zemu_install + - name: Run zemu tests + run: "cd tests_zemu; yarn test" + - name: Upload Snapshots (only failure) + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: snapshots-tmp + path: tests_zemu/snapshots-tmp/ build_package_nanos: - needs: - [ - configure, - cpp_test, - build_ledger_nano_S, - build_ledger_nano_X, - build_ledger_nano_SP, - build_ledger_stax, - test_zemu, - ] + needs: [configure, build, build_ledger, test_zemu] if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest container: @@ -148,7 +103,7 @@ jobs: BOLOS_SDK: /opt/nanos-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -157,7 +112,7 @@ jobs: - name: Build NanoS shell: bash -l {0} run: | - PRODUCTION_BUILD=0 make + make mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh - name: Set tag id: nanos @@ -173,17 +128,8 @@ jobs: draft: false prerelease: false - build_package_nanos_plus: - needs: - [ - configure, - cpp_test, - build_ledger_nano_S, - build_ledger_nano_X, - build_ledger_nano_SP, - build_ledger_stax, - test_zemu, - ] + build_package_nanosp: + needs: [configure, build, build_ledger, test_zemu] if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest container: @@ -193,7 +139,7 @@ jobs: BOLOS_SDK: /opt/nanosplus-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -202,7 +148,7 @@ jobs: - name: Build NanoSP shell: bash -l {0} run: | - PRODUCTION_BUILD=0make + make mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh - name: Set tag id: nanosp @@ -219,16 +165,7 @@ jobs: prerelease: false build_package_stax: - needs: - [ - configure, - cpp_test, - build_ledger_nano_S, - build_ledger_nano_X, - build_ledger_nano_SP, - build_ledger_stax, - test_zemu, - ] + needs: [configure, build, build_ledger, test_zemu] if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest container: @@ -238,7 +175,7 @@ jobs: BOLOS_SDK: /opt/stax-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -246,7 +183,8 @@ jobs: - name: Build Stax shell: bash -l {0} - run: PRODUCTION_BUILD=0 make + run: | + PRODUCTION_BUILD=0 make - name: Set tag id: stax run: echo "tag_name=$(./app/pkg/installer_stax.sh version)" >> $GITHUB_OUTPUT @@ -256,7 +194,44 @@ jobs: 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_stax.sh + files: | + ./app/pkg/installer_stax.sh tag_name: ${{ steps.stax.outputs.tag_name }} draft: false prerelease: false + + build_package_flex: + 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/flex-secure-sdk + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install deps + run: pip install ledgerblue + + - name: Build Flex + shell: bash -l {0} + run: | + PRODUCTION_BUILD=0 make + - name: Set tag + id: flex + run: echo "tag_name=$(./app/pkg/installer_flex.sh version)" >> $GITHUB_OUTPUT + - name: Update Release + id: update_release_2 + 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_flex.sh + tag_name: ${{ steps.flex.outputs.tag_name }} + draft: false + prerelease: false diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index 271f40ce..a69b91db 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit 271f40ce03219eac8396a309ce9704977cf59caa +Subproject commit a69b91dbe387f39e8d37a252673d0d0bb42361a2 diff --git a/ledger_app.toml b/ledger_app.toml index 3e4cbb1f..7f63dfec 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./app/" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", "flex"] [tests] unit_directory = "./tests/"