add option --get-stack-consumption #1514
Workflow file for this run
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, test and deploy Ragger | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - master | |
| - develop | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| # Cancel previous runs on this reference | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_boilerplate_application: | |
| name: Build boilerplate application using the reusable workflow | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | |
| with: | |
| app_repository: LedgerHQ/app-boilerplate | |
| app_branch_name: master | |
| upload_app_binaries_artifact: boilerplate_binaries | |
| build_boilerplate_application_nanos: | |
| name: Build boilerplate application for Nanos S using the reusable workflow | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | |
| with: | |
| app_repository: LedgerHQ/app-boilerplate | |
| app_branch_name: nanos_baseline | |
| upload_app_binaries_artifact: boilerplate_binaries_nanos | |
| prepare_matrix: | |
| name: Prepare matrix from TOML file | |
| runs-on: ubuntu-latest | |
| outputs: | |
| devices: ${{ steps.get_devices.outputs.devices }} | |
| env: | |
| APP_MANIFEST: "ledger_app.toml" | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| - name: Install ledgered | |
| run: pip install ledgered | |
| - name: Get devices from TOML | |
| id: get_devices | |
| run: | | |
| # get device list as a single line json formatted value | |
| compatible_devices="$(ledger-manifest --output-devices "${APP_MANIFEST}" -j | jq -rc '.devices')" | |
| echo "devices=${compatible_devices}" | sed 's/+/p/' >> "${GITHUB_OUTPUT}" | |
| build_install_test: | |
| name: Install and test the library | |
| needs: [prepare_matrix, build_boilerplate_application, build_boilerplate_application_nanos] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python_version: ['3.10', '3.11', '3.12', '3.13'] | |
| device: ${{ fromJson(needs.prepare_matrix.outputs.devices) }} | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python version | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python_version }} | |
| - name: Speculos dependencies | |
| run: sudo apt-get update && sudo apt-get install -y qemu-user-static tesseract-ocr libtesseract-dev python3-pyqt6 | |
| - name: Build & install | |
| run: | | |
| pip install -U .[tests,all_backends] | |
| pip install -U "click>=8" | |
| - name: Install speculos for Nanos | |
| if: ${{ matrix.device == 'nanos' }} | |
| run: | | |
| pip install -U speculos==v0.25.5 | |
| - name: Download app binaries | |
| if: ${{ matrix.device != 'nanos' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: boilerplate_binaries | |
| path: ./build/ | |
| - name: Download app binaries for Nano S | |
| if: ${{ matrix.device == 'nanos' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: boilerplate_binaries_nanos | |
| path: ./build/ | |
| - name: Check the downloaded files | |
| run: tree . | |
| - name: Run unit tests and generate coverage | |
| run: pytest -v --tb=short tests/unit --cov ragger --cov-report xml | |
| - name: Run functional tests and generate coverage | |
| run: pytest -v --tb=short tests/functional --cov ragger --cov-report xml --cov-append --device ${{ matrix.device }} | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| name: codecov-ragger | |
| flags: ${{ matrix.device }}-py${{ matrix.python_version }} | |
| package_and_deploy: | |
| name: Build and deploy the Ragger Python package | |
| needs: [build_install_test] | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1 | |
| with: | |
| package_name: ragger | |
| publish: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| secrets: | |
| pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }} |