Deduplicate ci.yml from #795 #260
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: CI | |
| on: | |
| # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request. | |
| pull_request: | |
| # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push. | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| concurrency: | |
| group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| LC_ALL: 'C.UTF-8' | |
| LANG: 'C.UTF-8' | |
| LANGUAGE: 'C.UTF-8' | |
| jobs: | |
| type-check: | |
| name: Type check | |
| runs-on: ubuntu-latest | |
| container: python:3.12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| pip install poetry | |
| poetry install | |
| - name: Run check | |
| run: > | |
| poetry run | |
| mypy | |
| hwi.py | |
| hwilib/_base58.py | |
| hwilib/_bech32.py | |
| hwilib/_cli.py | |
| hwilib/commands.py | |
| hwilib/common.py | |
| hwilib/descriptor.py | |
| hwilib/devices/bitbox02.py | |
| hwilib/devices/coldcard.py | |
| hwilib/devices/digitalbitbox.py | |
| hwilib/devices/jade.py | |
| hwilib/devices/__init__.py | |
| hwilib/devices/keepkey.py | |
| hwilib/devices/ledger.py | |
| hwilib/devices/trezor.py | |
| hwilib/errors.py | |
| hwilib/_script.py | |
| hwilib/_serialize.py | |
| hwilib/tx.py | |
| hwilib/hwwclient.py | |
| hwilib/__init__.py | |
| hwilib/key.py | |
| hwilib/udevinstaller.py | |
| non-device-tests: | |
| name: Non-device tests | |
| runs-on: ubuntu-latest | |
| container: python:3.12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| pip install poetry | |
| poetry install | |
| - name: Run tests | |
| run: | | |
| cd test; poetry run ./run_tests.py; cd .. | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| container: python:3.12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| pip install poetry | |
| poetry install | |
| - run: | | |
| poetry run flake8 | |
| wine-builder: | |
| name: Wine builder | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: contrib/build-wine.Dockerfile | |
| tags: build-wine-container | |
| load: true | |
| - run: > | |
| docker run --rm \ | |
| --volume ${{ github.workspace }}:${{ github.workspace }} \ | |
| --workdir ${{ github.workspace }} \ | |
| build-wine-container bash -c " | |
| git config --global --add safe.directory ${{ github.workspace }} | |
| contrib/build_wine.sh | |
| find dist -type f -exec sha256sum {} \; | |
| " | |
| dist-builder: | |
| name: Dist builder | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: contrib/build.Dockerfile | |
| tags: build-container | |
| load: true | |
| - run: > | |
| docker run --rm \ | |
| --volume ${{ github.workspace }}:${{ github.workspace }} \ | |
| --workdir ${{ github.workspace }} \ | |
| build-container bash -c " | |
| git config --global --add safe.directory ${{ github.workspace }} | |
| contrib/build_bin.sh | |
| contrib/build_dist.sh | |
| find dist -type f -exec sha256sum {} \; | |
| " | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| sim-builder-trezor: | |
| name: Trezor sim builder | |
| # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1 | |
| # binaries compatible with Debian Bookworm (glibc 2.36) Python containers. | |
| # Trezor T binaries don't need this. | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } | |
| - { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| sim-builder-coldcard: | |
| name: Coldcard sim builder | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'coldcard', archive: 'coldcard-mpy', paths: 'test/work/firmware/external/micropython/ports/unix/coldcard-mpy test/work/firmware/unix/coldcard-mpy test/work/firmware/unix/l-mpy test/work/firmware/unix/l-port' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| sim-builder-bitbox: | |
| name: Bitbox sim builder | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' } | |
| - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| sim-builder-jade: | |
| name: Jade sim builder | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'jade', archive: 'jade', paths: 'test/work/jade/simulator' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| sim-builder-ledger: | |
| name: Ledger sim builder | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| sim-builder-keepkey: | |
| name: Keepkey sim builder | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: | |
| - { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-sim | |
| ledger-s-app-builder: | |
| name: Ledger Nano S Bitcoin App builder | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | |
| steps: | |
| - run: | | |
| git clone https://github.com/LedgerHQ/app-bitcoin-new.git | |
| cd app-bitcoin-new | |
| make DEBUG=1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ledger_app_nano_s | |
| path: app-bitcoin-new/bin/app.elf | |
| ledger-x-app-builder: | |
| name: Ledger Nano X Bitcoin App builder | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | |
| steps: | |
| - run: | | |
| git clone https://github.com/LedgerHQ/app-bitcoin-new.git | |
| cd app-bitcoin-new | |
| make DEBUG=1 BOLOS_SDK=$NANOX_SDK | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ledger_app_nano_x | |
| path: app-bitcoin-new/bin/app.elf | |
| bitcoind-builder: | |
| name: bitcoind builder | |
| # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep binaries | |
| # compatible with Debian Bookworm (glibc 2.36) Python containers. | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-bitcoind | |
| test-trezor: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-latest | |
| needs: [ sim-builder-trezor, bitcoind-builder, dist-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'trezor-1' | |
| - 'trezor-t' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |
| test-ledger: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-latest | |
| needs: [ sim-builder-ledger, ledger-s-app-builder, ledger-x-app-builder, bitcoind-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'ledger' | |
| - 'ledger-legacy' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |
| test-coldcard: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-22.04 | |
| needs: [ sim-builder-coldcard, bitcoind-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'coldcard' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |
| test-bitbox: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-latest | |
| needs: [ sim-builder-bitbox, bitcoind-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'bitbox01' | |
| - 'bitbox02' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |
| test-jade: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-latest | |
| needs: [ sim-builder-jade, bitcoind-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'jade' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |
| test-keepkey: | |
| name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} | |
| runs-on: ubuntu-latest | |
| needs: [ sim-builder-keepkey, bitcoind-builder ] | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
| device: | |
| - 'keepkey' | |
| test: | |
| - {interface: 'library'} | |
| - {interface: 'cli'} | |
| - {interface: 'stdin'} | |
| - {script: 'Wheel'} | |
| - {script: 'Sdist'} | |
| - {script: 'Bindist'} | |
| container: python:${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: run test | |
| if: ${{ matrix.test.interface }} | |
| uses: ./.github/actions/test-device | |
| - name: run dist test | |
| if: ${{ matrix.test.script }} | |
| uses: ./.github/actions/test-dist | |