Skip to content

Commit 41ca9e8

Browse files
Sjorsclaude
andcommitted
ci: move type check and simbuilds to own file
Co-authored-by: Claude <claude@anthropic.com>
1 parent 386edfb commit 41ca9e8

File tree

3 files changed

+161
-159
lines changed

3 files changed

+161
-159
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,6 @@ env:
1919
LANGUAGE: 'C.UTF-8'
2020

2121
jobs:
22-
type-check:
23-
name: Type check
24-
runs-on: ubuntu-latest
25-
container: python:3.12
26-
steps:
27-
- uses: actions/checkout@v4
28-
29-
- run: |
30-
pip install poetry
31-
poetry install
32-
33-
- name: Run check
34-
run: >
35-
poetry run
36-
mypy
37-
hwi.py
38-
hwilib/_base58.py
39-
hwilib/_bech32.py
40-
hwilib/_cli.py
41-
hwilib/commands.py
42-
hwilib/common.py
43-
hwilib/descriptor.py
44-
hwilib/devices/bitbox02.py
45-
hwilib/devices/coldcard.py
46-
hwilib/devices/digitalbitbox.py
47-
hwilib/devices/jade.py
48-
hwilib/devices/__init__.py
49-
hwilib/devices/keepkey.py
50-
hwilib/devices/ledger.py
51-
hwilib/devices/trezor.py
52-
hwilib/errors.py
53-
hwilib/_script.py
54-
hwilib/_serialize.py
55-
hwilib/tx.py
56-
hwilib/hwwclient.py
57-
hwilib/__init__.py
58-
hwilib/key.py
59-
hwilib/udevinstaller.py
60-
6122
non-device-tests:
6223
name: Non-device tests
6324
runs-on: ubuntu-latest
@@ -142,126 +103,8 @@ jobs:
142103
name: dist
143104
path: dist/
144105

145-
sim-builder-trezor:
146-
name: Trezor sim builder
147-
# Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1
148-
# binaries compatible with Debian Bookworm (glibc 2.36) Python containers.
149-
# Trezor T binaries don't need this.
150-
runs-on: ubuntu-22.04
151-
152-
strategy:
153-
fail-fast: false
154-
matrix:
155-
device:
156-
- { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
157-
- { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
158-
159-
steps:
160-
- uses: actions/checkout@v4
161-
- uses: ./.github/actions/build-sim
162-
163-
sim-builder-coldcard:
164-
name: Coldcard sim builder
165-
runs-on: ubuntu-22.04
166-
167-
strategy:
168-
fail-fast: false
169-
matrix:
170-
device:
171-
- { 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' }
172-
173-
steps:
174-
- uses: actions/checkout@v4
175-
- uses: ./.github/actions/build-sim
176-
177-
sim-builder-bitbox:
178-
name: Bitbox sim builder
179-
runs-on: ubuntu-latest
180-
181-
strategy:
182-
fail-fast: false
183-
matrix:
184-
device:
185-
- { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' }
186-
- { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' }
187-
188-
steps:
189-
- uses: actions/checkout@v4
190-
- uses: ./.github/actions/build-sim
191-
192-
sim-builder-jade:
193-
name: Jade sim builder
194-
runs-on: ubuntu-latest
195-
196-
strategy:
197-
fail-fast: false
198-
matrix:
199-
device:
200-
- { name: 'jade', archive: 'jade', paths: 'test/work/jade/simulator' }
201-
202-
steps:
203-
- uses: actions/checkout@v4
204-
- uses: ./.github/actions/build-sim
205-
206-
sim-builder-ledger:
207-
name: Ledger sim builder
208-
runs-on: ubuntu-latest
209-
210-
strategy:
211-
fail-fast: false
212-
matrix:
213-
device:
214-
- { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' }
215-
216-
steps:
217-
- uses: actions/checkout@v4
218-
- uses: ./.github/actions/build-sim
219-
220-
sim-builder-keepkey:
221-
name: Keepkey sim builder
222-
runs-on: ubuntu-22.04
223-
224-
strategy:
225-
fail-fast: false
226-
matrix:
227-
device:
228-
- { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' }
229-
230-
steps:
231-
- uses: actions/checkout@v4
232-
- uses: ./.github/actions/build-sim
233-
234-
235-
ledger-s-app-builder:
236-
name: Ledger Nano S Bitcoin App builder
237-
runs-on: ubuntu-latest
238-
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
239-
steps:
240-
- run: |
241-
git clone https://github.com/LedgerHQ/app-bitcoin-new.git
242-
cd app-bitcoin-new
243-
make DEBUG=1
244-
245-
- uses: actions/upload-artifact@v4
246-
with:
247-
name: ledger_app_nano_s
248-
path: app-bitcoin-new/bin/app.elf
249-
250-
251-
ledger-x-app-builder:
252-
name: Ledger Nano X Bitcoin App builder
253-
runs-on: ubuntu-latest
254-
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
255-
steps:
256-
- run: |
257-
git clone https://github.com/LedgerHQ/app-bitcoin-new.git
258-
cd app-bitcoin-new
259-
make DEBUG=1 BOLOS_SDK=$NANOX_SDK
260-
261-
- uses: actions/upload-artifact@v4
262-
with:
263-
name: ledger_app_nano_x
264-
path: app-bitcoin-new/bin/app.elf
106+
sim-builders:
107+
uses: ./.github/workflows/sim-builder.yml
265108

266109
bitcoind-builder:
267110
name: bitcoind builder

.github/workflows/sim-builder.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Simulator Builder
2+
on:
3+
workflow_call:
4+
outputs:
5+
matrix:
6+
description: "Build matrix result"
7+
value: ${{ jobs.sim-builder.outputs.matrix }}
8+
9+
jobs:
10+
sim-builder-trezor:
11+
name: Trezor sim builder
12+
# Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1
13+
# binaries compatible with Debian Bookworm (glibc 2.36) Python containers.
14+
# Trezor T binaries don't need this.
15+
runs-on: ubuntu-22.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
device:
20+
- { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
21+
- { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' }
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: ./.github/actions/build-sim
25+
26+
sim-builder-coldcard:
27+
name: Coldcard sim builder
28+
runs-on: ubuntu-22.04
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
device:
33+
- { 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' }
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: ./.github/actions/build-sim
37+
38+
sim-builder-bitbox:
39+
name: Bitbox sim builder
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
device:
45+
- { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' }
46+
- { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' }
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: ./.github/actions/build-sim
50+
51+
sim-builder-jade:
52+
name: Jade sim builder
53+
runs-on: ubuntu-latest
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
device:
58+
- { name: 'jade', archive: 'jade', paths: 'test/work/jade/simulator' }
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: ./.github/actions/build-sim
62+
63+
sim-builder-ledger:
64+
name: Ledger sim builder
65+
runs-on: ubuntu-latest
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
device:
70+
- { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' }
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: ./.github/actions/build-sim
74+
75+
sim-builder-keepkey:
76+
name: Keepkey sim builder
77+
runs-on: ubuntu-22.04
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
device:
82+
- { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' }
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: ./.github/actions/build-sim
86+
87+
ledger-s-app-builder:
88+
name: Ledger Nano S Bitcoin App builder
89+
runs-on: ubuntu-latest
90+
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
91+
steps:
92+
- run: |
93+
git clone https://github.com/LedgerHQ/app-bitcoin-new.git
94+
cd app-bitcoin-new
95+
make DEBUG=1
96+
97+
- uses: actions/upload-artifact@v4
98+
with:
99+
name: ledger_app_nano_s
100+
path: app-bitcoin-new/bin/app.elf
101+
102+
103+
ledger-x-app-builder:
104+
name: Ledger Nano X Bitcoin App builder
105+
runs-on: ubuntu-latest
106+
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
107+
steps:
108+
- run: |
109+
git clone https://github.com/LedgerHQ/app-bitcoin-new.git
110+
cd app-bitcoin-new
111+
make DEBUG=1 BOLOS_SDK=$NANOX_SDK
112+
113+
- uses: actions/upload-artifact@v4
114+
with:
115+
name: ledger_app_nano_x
116+
path: app-bitcoin-new/bin/app.elf

.github/workflows/type-check.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Type Check
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
type-check:
7+
name: Type check
8+
runs-on: ubuntu-latest
9+
container: python:3.12
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- run: |
14+
pip install poetry
15+
poetry install
16+
17+
- name: Run check
18+
run: >
19+
poetry run
20+
mypy
21+
hwi.py
22+
hwilib/_base58.py
23+
hwilib/_bech32.py
24+
hwilib/_cli.py
25+
hwilib/commands.py
26+
hwilib/common.py
27+
hwilib/descriptor.py
28+
hwilib/devices/bitbox02.py
29+
hwilib/devices/coldcard.py
30+
hwilib/devices/digitalbitbox.py
31+
hwilib/devices/jade.py
32+
hwilib/devices/__init__.py
33+
hwilib/devices/keepkey.py
34+
hwilib/devices/ledger.py
35+
hwilib/devices/trezor.py
36+
hwilib/errors.py
37+
hwilib/_script.py
38+
hwilib/_serialize.py
39+
hwilib/tx.py
40+
hwilib/hwwclient.py
41+
hwilib/__init__.py
42+
hwilib/key.py
43+
hwilib/udevinstaller.py

0 commit comments

Comments
 (0)