Fix NBGL #1668
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build all C apps on latest C SDK | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| sdk_branch: | |
| type: string | |
| required: false | |
| default: '' | |
| pull_request: | |
| jobs: | |
| prepare-matrix: | |
| name: Retrieve C apps | |
| runs-on: ubuntu-latest | |
| outputs: | |
| c_apps: ${{ steps.get_c_apps.outputs.c_apps }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install ledgered | |
| run: pip install ledgered | |
| - name: Get all C apps | |
| id: get_c_apps | |
| run: | | |
| python .github/workflows/scripts/get_c_apps.py ${{ secrets.GITHUB_TOKEN }} | |
| echo "c_apps=$(cat c_apps.json)" >> $GITHUB_OUTPUT | |
| print-matrix: | |
| needs: [prepare-matrix] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Print matrix | |
| run: | | |
| echo "Matrix content: ${{ needs.prepare-matrix.outputs.c_apps }}" | |
| test-build: | |
| name: Build for all targets | |
| needs: [prepare-matrix] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| apps: ${{ fromJSON(needs.prepare-matrix.outputs.c_apps) }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| # Some C apps embed a Rust component pinned (via rust-toolchain.toml) to a | |
| # toolchain that differs from the one the builder image exports through | |
| # RUSTUP_TOOLCHAIN. A set RUSTUP_TOOLCHAIN overrides that pin and breaks | |
| # the build, so it is unset before make for these apps (see build steps). | |
| RUSTUP_TOOLCHAIN_UNSET_APPS: "app-namada app-stacks" | |
| steps: | |
| - name: Clone App | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: LedgerHQ/${{ matrix.apps.app-name }} | |
| submodules: recursive | |
| path: ${{ matrix.apps.app-name }} | |
| - name: Clone SDK | |
| uses: actions/checkout@v6 | |
| with: | |
| path: sdk | |
| ref: ${{ inputs.sdk_branch || github.head_ref }} | |
| - name: Install prerequisites | |
| run: pip install --break-system-packages ledgered | |
| - name: Build App for Nano X | |
| if: contains(matrix.apps.devices, 'nanox') | |
| run: | | |
| cd ${{ matrix.apps.app-name }}/${{ matrix.apps.build-directory }} | |
| echo "Building for Nano X" | |
| if [[ " $RUSTUP_TOOLCHAIN_UNSET_APPS " == *" ${{ matrix.apps.app-name }} "* ]]; then unset RUSTUP_TOOLCHAIN; fi | |
| make clean | |
| make TARGET=nanox BOLOS_SDK=$GITHUB_WORKSPACE/sdk | |
| - name: Build App for Nano S+ | |
| if: contains(matrix.apps.devices, 'nanos+') | |
| run: | | |
| cd ${{ matrix.apps.app-name }}/${{ matrix.apps.build-directory }} | |
| echo "Building for Nano S+" | |
| if [[ " $RUSTUP_TOOLCHAIN_UNSET_APPS " == *" ${{ matrix.apps.app-name }} "* ]]; then unset RUSTUP_TOOLCHAIN; fi | |
| make clean | |
| make TARGET=nanos2 BOLOS_SDK=$GITHUB_WORKSPACE/sdk | |
| - name: Build App for Stax | |
| if: contains(matrix.apps.devices, 'stax') | |
| run: | | |
| cd ${{ matrix.apps.app-name }}/${{ matrix.apps.build-directory }} | |
| echo "Building for Stax" | |
| if [[ " $RUSTUP_TOOLCHAIN_UNSET_APPS " == *" ${{ matrix.apps.app-name }} "* ]]; then unset RUSTUP_TOOLCHAIN; fi | |
| make clean | |
| make TARGET=stax BOLOS_SDK=$GITHUB_WORKSPACE/sdk | |
| - name: Build App for Flex | |
| if: contains(matrix.apps.devices, 'flex') | |
| run: | | |
| cd ${{ matrix.apps.app-name }}/${{ matrix.apps.build-directory }} | |
| echo "Building for Flex" | |
| if [[ " $RUSTUP_TOOLCHAIN_UNSET_APPS " == *" ${{ matrix.apps.app-name }} "* ]]; then unset RUSTUP_TOOLCHAIN; fi | |
| make clean | |
| make TARGET=flex BOLOS_SDK=$GITHUB_WORKSPACE/sdk | |
| - name: Build App for Apex+ | |
| if: contains(matrix.apps.devices, 'apex_p') | |
| run: | | |
| cd ${{ matrix.apps.app-name }}/${{ matrix.apps.build-directory }} | |
| echo "Building for Apex+" | |
| if [[ " $RUSTUP_TOOLCHAIN_UNSET_APPS " == *" ${{ matrix.apps.app-name }} "* ]]; then unset RUSTUP_TOOLCHAIN; fi | |
| make clean | |
| make TARGET=apex_p BOLOS_SDK=$GITHUB_WORKSPACE/sdk |