Skip to content

Support API level 26 #2320

Support API level 26

Support API level 26 #2320

name: Continuous Integration & Deployment
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- master
pull_request:
branches:
- master
# Cancel previous runs on this reference
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYGAME_HIDE_SUPPORT_PROMPT: 1
jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
container:
image: docker://ghcr.io/ledgerhq/speculos-builder:latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build with code coverage instrumentation
env:
CTEST_OUTPUT_ON_FAILURE: 1
RNG_SEED: 0
run: |
cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1 -DCODE_COVERAGE=ON
make -C build clean
make -C build
make -C build test
pip install pytest-cov
pip install .
PYTHONPATH=. pytest --cov=speculos --cov-report=xml
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
name: codecov-speculos
build:
name: Clone, build, test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.11', '3.12', '3.13']
# Use https://ghcr.io/ledgerhq/speculos-builder which has all the required
# dependencies
container:
image: docker://ghcr.io/ledgerhq/speculos-builder:latest
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: Build and install package
run: |
cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1
make -C build
pip install pytest
pip install .
- name: Test
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: |
make -C build/ test
pytest
deploy:
name: Build and deploy speculos package
needs: build
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1
with:
package_name: speculos
jfrog_deployment: true
release: ${{ startsWith(github.ref, 'refs/tags/') }}
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
container: ghcr.io/ledgerhq/speculos-builder:latest
secrets:
pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}
package_and_test_docker:
name: Build and test the Speculos docker
uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
with:
app_repository: LedgerHQ/app-boilerplate
app_branch_name: master
package_and_test_docker_rust:
name: Build and test the Speculos docker with a Rust app
uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
with:
app_repository: LedgerHQ/app-boilerplate-rust
app_branch_name: main