11# KeepKey python-keepkey CI
22#
3- # Pulls the published emulator image (kktech/kkemu) from DockerHub
4- # and runs the full python integration test suite against it .
3+ # Builds the 7.14.3 Bitcoin-only emulator from the fork release branch and
4+ # runs the full Python integration suite against that exact product variant .
55#
66# Stage 1: GATE (seconds)
77# └─ lint Python syntax + deterministic protocol contract tests
@@ -66,10 +66,10 @@ jobs:
6666 echo "| Offline fixture integrity | ✅ PASS |" >> "$GITHUB_STEP_SUMMARY"
6767 FIXTURE_SHA=$(sha256sum tests/txcache/manifest.json | cut -d' ' -f1)
6868 echo "" >> "$GITHUB_STEP_SUMMARY"
69- echo " Fixture manifest SHA-256: `$FIXTURE_SHA` " >> "$GITHUB_STEP_SUMMARY"
69+ printf ' Fixture manifest SHA-256: `%s`\n' " $FIXTURE_SHA" >> "$GITHUB_STEP_SUMMARY"
7070
7171 # ═══════════════════════════════════════════════════════════
72- # STAGE 2: TEST — pull published emulator, run pytest
72+ # STAGE 2: TEST — build Bitcoin-only emulator, run pytest
7373 # ═══════════════════════════════════════════════════════════
7474
7575 integration :
@@ -129,7 +129,8 @@ jobs:
129129 timeout-minutes : 20
130130 working-directory : keepkey-firmware
131131 run : |
132- docker build -t kkemu-ci -f scripts/emulator/Dockerfile .
132+ docker build --build-arg coinsupport=-DKK_BITCOIN_ONLY=ON \
133+ -t kkemu-ci -f scripts/emulator/Dockerfile .
133134
134135 - name : Start the emulator
135136 run : |
@@ -153,15 +154,22 @@ jobs:
153154 - name : Wait for emulator
154155 run : |
155156 echo "Waiting for emulator bridge on port 5000..."
157+ ready=false
156158 for i in $(seq 1 30); do
157159 if curl -sf -X POST http://localhost:5000/exchange/main \
158160 -H 'Content-Type: application/json' \
159161 -d '{"data":""}' > /dev/null 2>&1; then
160162 echo "Emulator ready after ${i}s"
163+ ready=true
161164 break
162165 fi
163166 sleep 1
164167 done
168+ [ "$ready" = true ] || {
169+ docker logs kkemu
170+ echo "FATAL: emulator bridge did not become ready" >&2
171+ exit 1
172+ }
165173
166174 # "The emulator answered a ping" is not "the emulator is the right
167175 # firmware". CI ran a 7.16-era suite against a 7.10.0 image for five
@@ -177,6 +185,7 @@ jobs:
177185 KK_TRANSPORT_DEBUG : " 127.0.0.1:11045"
178186 KK_MIN_FW : " 7.14.3"
179187 KK_UDP_TIMEOUT : " 20"
188+ KK_EXPECTED_VARIANT : " EmulatorBTC"
180189 working-directory : keepkey-firmware/deps/python-keepkey/tests
181190 run : |
182191 python - <<'PY'
@@ -198,6 +207,10 @@ jobs:
198207 sys.exit('FATAL: the emulator image predates the tests that run '
199208 'against it. Republish kktech/kkemu from current '
200209 'firmware and pin the new digest above.')
210+ if f.firmware_variant != os.environ['KK_EXPECTED_VARIANT']:
211+ sys.exit('FATAL: expected %s, got firmware variant %r' %
212+ (os.environ['KK_EXPECTED_VARIANT'],
213+ f.firmware_variant))
201214 PY
202215
203216 # Step-level timeout, deliberately: a JOB-level timeout ends the job as
@@ -208,6 +221,7 @@ jobs:
208221 KK_TRANSPORT_MAIN : " 127.0.0.1:11044"
209222 KK_TRANSPORT_DEBUG : " 127.0.0.1:11045"
210223 PYTHONPATH : " ${{ github.workspace }}/keepkey-firmware/deps/python-keepkey"
224+ PYTHONUNBUFFERED : " 1"
211225 # A crashed emulator now raises instead of blocking in recv() forever.
212226 KK_UDP_TIMEOUT : " 45"
213227 run : |
@@ -235,7 +249,7 @@ jobs:
235249 echo "" >> "$GITHUB_STEP_SUMMARY"
236250 if [ -f "$MANIFEST" ]; then
237251 FIXTURE_SHA=$(sha256sum "$MANIFEST" | cut -d' ' -f1)
238- echo " Fixture manifest SHA-256: `$FIXTURE_SHA` " >> "$GITHUB_STEP_SUMMARY"
252+ printf ' Fixture manifest SHA-256: `%s`\n' " $FIXTURE_SHA" >> "$GITHUB_STEP_SUMMARY"
239253 echo "" >> "$GITHUB_STEP_SUMMARY"
240254 fi
241255
0 commit comments