Y333/apex support #806
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: Run cargo clippy, cargo fmt, build and Unit+Integration tests | |
on: | |
push: | |
branches: | |
master | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: 'Manually triggered' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
clippy: | |
name: Run static analysis | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest | |
strategy: | |
matrix: | |
target: ["nanox", "nanosplus", "stax", "flex"] | |
package: [include_gif, testmacro, ledger_secure_sdk_sys, ledger_device_sdk] | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Cargo clippy | |
working-directory: ${{ matrix.package }} | |
run: | | |
# to be suppressed when C SDK API_LEVEL_24 is available in dev-tools | |
git clone https://github.com/LedgerHQ/ledger-secure-sdk.git --branch API_LEVEL_24 --single-branch c_sdk | |
echo "setting LEDGER_SDK_PATH to $(realpath c_sdk)" | |
export LEDGER_SDK_PATH=$(realpath c_sdk) | |
# ####################################### # | |
cargo clippy --target ${{ matrix.target }} | |
format: | |
name: Check code formatting | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Run cargo fmt | |
run: | | |
cargo fmt --all --check | |
build: | |
name: Build SDK | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest | |
strategy: | |
matrix: | |
target: ["nanox", "nanosplus", "stax", "flex"] | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Cargo build | |
working-directory: ledger_device_sdk | |
run: | | |
# to be suppressed when C SDK API_LEVEL_24 is available in dev-tools | |
git clone https://github.com/LedgerHQ/ledger-secure-sdk.git --branch API_LEVEL_24 --single-branch c_sdk | |
echo "setting LEDGER_SDK_PATH to $(realpath c_sdk)" | |
export LEDGER_SDK_PATH=$(realpath c_sdk) | |
# ####################################### # | |
cargo build --target ${{ matrix.target }} | |
if [[ "${{ matrix.target }}" == "nanosplus" || "${{ matrix.target }}" == "nanox" ]]; then | |
cargo build --target ${{ matrix.target }} --features nano_nbgl; | |
fi | |
test: | |
name: Run unit and integration tests | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest | |
strategy: | |
matrix: | |
target: ["nanox", "nanosplus", "stax", "flex"] | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Unit tests | |
working-directory: ledger_device_sdk | |
run: | | |
# to be suppressed when C SDK API_LEVEL_24 is available in dev-tools | |
git clone https://github.com/LedgerHQ/ledger-secure-sdk.git --branch API_LEVEL_24 --single-branch c_sdk | |
echo "setting LEDGER_SDK_PATH to $(realpath c_sdk)" | |
export LEDGER_SDK_PATH=$(realpath c_sdk) | |
pip install -U speculos --break-system-packages | |
# ####################################### # | |
cargo test --target ${{ matrix.target }} --features speculos,debug --tests | |
build-apps: | |
name: Build all Rust apps | |
uses: ./.github/workflows/reusable_build_all_apps.yml | |
with: | |
rust_sdk_branch: ${{ github.ref }} | |
c_sdk_branch: API_LEVEL_24 |