Tdj/test ci #110
This file contains 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 | |
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: tdj/remove_nanoS_support | |
upload_app_binaries_artifact: boilerplate_binaries | |
build_boilerplate_application_nanos: | |
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: nanos_baseline | |
run_for_devices: '["nanos"]' | |
upload_app_binaries_artifact: boilerplate_binaries_nanos | |
build_install_test: | |
name: Install and test the library | |
needs: [build_boilerplate_application_nanos, build_boilerplate_application] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: ['3.8', '3.9', '3.10', '3.11'] | |
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 | |
- name: Build & install | |
run: | | |
pip install -U .[tests,all_backends] | |
pip install -U "click>=8" | |
- name: Download app binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: boilerplate_binaries | |
path: ./build/ | |
- name: Download app binaries nano S | |
uses: actions/download-artifact@v4 | |
with: | |
name: boilerplate_binaries_nanos | |
path: ./build/ | |
- name: Create boilerplate manifest | |
run: | | |
echo """[app] | |
build_directory = \"./\" | |
sdk = \"C\" | |
devices = [\"nanos\", \"nanos+\", \"nanox\", \"stax\", \"flex\"]""" > ledger_app.toml | |
- 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 all | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
name: codecov-ragger |