Skip to content

Commit 4e342db

Browse files
committed
Merge #795: Fix CI
70e14aa ci: move type check and simbuilds to own file (Sjors Provoost) b2e1405 ci: use Device Test Template (Sjors Provoost) 6b923c8 ci: combine dist and test jobs (Sjors Provoost) 48e5b9a bitbox02: fix path to simulator (Marko Bencun) 1c53f9a support BitBox02 Nova by updating bitbox02 lib to v7.0.0 (Marko Bencun) e771d31 ci: pin non-device jobs to Python 3.12 (Sjors Provoost) 5f0edff ledger: use NanoX (Sjors Provoost) a482d15 ci: downgrade Trezor sim builder to Ubuntu 22.04 (Sjors Provoost) 0639d6d ci: downgrade Coinkite sim builder and tests to Ubuntu 22.04 (Sjors Provoost) 260277f ci: downgrade Keepkey sim builder to Ubuntu 22.04 (Sjors Provoost) 536e9cb ci: split device groups (Sjors Provoost) 4aa0b26 Revert "ci: Always run test" (Sjors Provoost) 3d7c3c9 ledger: disable several tests for NanoX (Sjors Provoost) 79bc788 ledger: add missing ledgerd (Sjors Provoost) 103d70d ledger: add missing flask-cors (Sjors Provoost) 598aad2 coldcard: disable test_signtx (Sjors Provoost) 7dc2579 coldcard: use --headless (Sjors Provoost) 451efa6 coldcard: install pysdl2-dll (Sjors Provoost) ba3c050 coldcard: update multisig patch (Sjors Provoost) a539f1b coldcard: drop address patch (Sjors Provoost) 514fe63 ci: build bitcoind with Ubuntu 22.04 (Sjors Provoost) 4457bac Set 60 second timeout on proc.communicate (Sjors Provoost) 48d965d ci: abort if simulator fails to start (Sjors Provoost) 784342f ci: abort if bitcoind fails to start (Sjors Provoost) 9c83f52 jade setup_environment: update qemu installation (Jamie C. Driver) c5f62a0 ci: fix rust emulator build failure (Sjors Provoost) 72bbef2 ci: .github match 'on' from Bitcoin Core (Sjors Provoost) 8215159 build: bump debian to bookworm (Sjors Provoost) b8d7147 Drop Python 3.8 (Sjors Provoost) 07b3ae7 ci: bump docker/build-push-action to v6 (Sjors Provoost) 6149775 Adjust bitcoind location (Sjors Provoost) Pull request description: - Modernize - bump build.Dockerfile to Debian bookworm - bump https://github.com/docker/build-push-action from v5 to v6 (probably wasn't the issue) - drop Python 3.8: https://devguide.python.org/versions/ (some jobs were failing, though I didn't investigate) - glibc compatility - downgrade build machines for Ledger, Keepkey and Coldcard simulators to fix their build - downgrade build machines for Trezor simulator for glibc compatibility - Robustness / CI performance - revert #743 - split device groups (see picture below) - abort test if any simulator fails to start - bitcoind - `src/bitcoind` was moved to `bin/bitcoind` by bitcoin/bitcoin#31161 - build `bitcoind` with Ubuntu 22.04 for glibc compatibility - abort test if bitoind fails to start - Coldcard - update patches - add `pysdl2-dll` - use `--headless` - Jade - include #779 - Ledger - use LedgerX app (except for legacy) - update PyQt to 6 for Speculos: LedgerHQ/speculos#565 - add `flask-cors` - add `ledgerd` - Trezor - add missing rust-src dependency The simulator build jobs as well as the simulator test jobs are split in one group per device brand. This means that the failure of one simulator to build will only cancels jobs for that simulator and not the other ones. Previously this was done in #743 using `always()`, but that's a bit overkill. <img width="968" height="681" alt="Schermafbeelding 2025-08-29 om 19 09 56" src="https://github.com/user-attachments/assets/b69d8a3b-5f38-481d-90b8-5731fb2c60b6" /> Issues left for a followup: - #799 - #800 ACKs for top commit: achow101: ACK 70e14aa Tree-SHA512: 9e7af775fe4d1b9faa77827055d4ac31c4d619b07277bdb940e8ede7eaf833484e2b33a0bd4751cd8227f44e7991d428edaaeb25a404a16ec1ca93d90a563145
2 parents 5f533aa + 70e14aa commit 4e342db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2289
-1568
lines changed

.github/actions/build-bitcoind/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
ccache --zero-stats
2424
cd test; ./setup_environment.sh --bitcoind; cd ..
2525
ccache --show-stats --verbose
26-
tar -czf bitcoind.tar.gz test/work/bitcoin/build/src/bitcoind
26+
tar -czf bitcoind.tar.gz test/work/bitcoin/build/bin/bitcoind
2727
2828
- uses: actions/cache/save@v4
2929
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build sim
2+
description: Build device simulator(s)
3+
inputs:
4+
name:
5+
description: Device name from matrix (e.g. trezor-1, coldcard, jade)
6+
required: true
7+
archive:
8+
description: Archive base name (e.g. trezor-firmware)
9+
required: true
10+
paths:
11+
description: Space-separated paths to include in the archive
12+
required: true
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Install dependencies
17+
shell: bash
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build
21+
pip install poetry
22+
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip
23+
sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local
24+
protoc --version
25+
26+
- name: Build simulator
27+
shell: bash
28+
run: |
29+
set -euxo pipefail
30+
git config --global user.email '[email protected]'
31+
git config --global user.name 'ci'
32+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
33+
cd test
34+
./setup_environment.sh --"${{ inputs.name }}"
35+
cd ..
36+
tar -czf "${{ inputs.archive }}.tar.gz" ${{ inputs.paths }}
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: ${{ inputs.name }}-sim
41+
path: ${{ inputs.archive }}.tar.gz
42+

.github/actions/install-sim/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ runs:
3030
pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd
3131
poetry run pip install -r test/work/firmware/requirements.txt
3232
pip install -r test/work/firmware/requirements.txt
33+
poetry run pip install pysdl2-dll
34+
pip install pysdl2-dll
3335
3436
- if: inputs.device == 'bitbox01'
3537
shell: bash
@@ -58,13 +60,14 @@ runs:
5860
apt-get update
5961
apt-get install -y libusb-1.0-0 qemu-user-static
6062
tar -xvf speculos.tar.gz
61-
poetry run pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
62-
pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
63+
poetry run pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract
64+
pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract
6365
6466
- if: inputs.device == 'ledger'
6567
uses: actions/download-artifact@v4
6668
with:
67-
name: ledger_app
69+
name: ${{ inputs.device == 'ledger-legacy' && 'ledger_app_nano_s' || 'ledger_app_nano_x' }}
70+
6871

6972
- if: inputs.device == 'ledger'
7073
shell: bash
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test device
2+
description: Run tests for one device type.
3+
runs:
4+
using: composite
5+
steps:
6+
- shell: bash
7+
run: |
8+
pip install poetry
9+
poetry install
10+
11+
- uses: actions/download-artifact@v4
12+
with:
13+
name: bitcoind
14+
15+
- shell: bash
16+
run: |
17+
tar -xvf bitcoind.tar.gz
18+
19+
- uses: ./.github/actions/install-sim
20+
with:
21+
device: ${{ matrix.device }}
22+
23+
- name: Run tests
24+
shell: bash
25+
run: |
26+
cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.test.interface }} --device-only; cd ..
27+
28+
- if: failure()
29+
shell: bash
30+
run: |
31+
tail -v -n +1 test/*.std*
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test dist
2+
description: Run dist tests for one device type.
3+
runs:
4+
using: composite
5+
steps:
6+
- shell: bash
7+
run: |
8+
pip install poetry
9+
10+
- uses: actions/download-artifact@v4
11+
with:
12+
name: dist
13+
path: dist/
14+
15+
- name: Install (Wheel)
16+
if: matrix.test.script == 'Wheel'
17+
shell: bash
18+
run: |
19+
pip install dist/*.whl
20+
21+
- name: Install (Sdist)
22+
if: matrix.test.script == 'Sdist'
23+
shell: bash
24+
run: |
25+
pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*")
26+
27+
- name: Install (Bindist)
28+
if: matrix.test.script == 'Bindist'
29+
shell: bash
30+
run: |
31+
poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd ..
32+
33+
- uses: actions/download-artifact@v4
34+
with:
35+
name: bitcoind
36+
37+
- shell: bash
38+
run: |
39+
tar -xvf bitcoind.tar.gz
40+
41+
- uses: ./.github/actions/install-sim
42+
with:
43+
device: ${{ matrix.device }}
44+
45+
- name: Run tests (Wheel)
46+
if: matrix.test.script == 'Wheel'
47+
shell: bash
48+
run: |
49+
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
50+
51+
- name: Run tests (Sdist)
52+
if: matrix.test.script == 'Sdist'
53+
shell: bash
54+
run: |
55+
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
56+
57+
- name: Run tests (Bindist)
58+
if: matrix.test.script == 'Bindist'
59+
shell: bash
60+
run: |
61+
cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..
62+
63+
- if: failure()
64+
shell: bash
65+
run: |
66+
tail -v -n +1 test/*.std*
67+

.github/sim-build-map.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"trezor": [
3+
{ "name": "trezor-1", "archive": "trezor-firmware", "paths": "test/work/trezor-firmware" },
4+
{ "name": "trezor-t", "archive": "trezor-firmware", "paths": "test/work/trezor-firmware" }
5+
],
6+
"coldcard": [
7+
{ "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" }
8+
],
9+
"bitbox": [
10+
{ "name": "bitbox01", "archive": "mcu", "paths": "test/work/mcu" },
11+
{ "name": "bitbox02", "archive": "bitbox02", "paths": "test/work/bitbox02-firmware/build-build-noasan/bin/simulator" }
12+
],
13+
"jade": [
14+
{ "name": "jade", "archive": "jade", "paths": "test/work/jade/simulator" }
15+
],
16+
"ledger": [
17+
{ "name": "ledger", "archive": "speculos", "paths": "test/work/speculos" }
18+
],
19+
"keepkey": [
20+
{ "name": "keepkey", "archive": "keepkey-firmware", "paths": "test/work/keepkey-firmware/bin" }
21+
]
22+
}

0 commit comments

Comments
 (0)