|
1 | | -version: 2 |
| 1 | +version: 2 # keep 2.0 syntax; CircleCI 2.1 also works |
| 2 | + |
2 | 3 | jobs: |
3 | 4 | emulator-build-test: |
4 | 5 | docker: |
5 | | - - image: circleci/python:3.7 |
| 6 | + - image: circleci/python:3.7 # upgrade to cimg/python:3.12 if you like |
6 | 7 | steps: |
7 | | - - checkout: |
8 | | - path: .pykk |
| 8 | + # ──────────────────────────────────────────────────────────────── |
| 9 | + # 1) Pull python-keepkey via HTTPS so no SSH key is required |
| 10 | + # ──────────────────────────────────────────────────────────────── |
| 11 | + - run: |
| 12 | + name: Clone python-keepkey |
| 13 | + command: git clone --depth 1 https://github.com/keepkey/python-keepkey.git .pykk |
| 14 | + |
| 15 | + # ──────────────────────────────────────────────────────────────── |
| 16 | + # 2) Grab firmware repo and inject our fresh python-keepkey copy |
| 17 | + # ──────────────────────────────────────────────────────────────── |
9 | 18 | - run: |
10 | | - name: Checkout Firmware & Inject python-keepkey |
| 19 | + name: Checkout firmware & inject python-keepkey |
11 | 20 | command: | |
| 21 | + # Ensure all submodule URLs fall back to HTTPS |
12 | 22 | git config --global url."https://github.com/".insteadOf git@github.com: |
13 | 23 | git config --global url."https://".insteadOf git:// |
| 24 | +
|
| 25 | + # Move python-keepkey out of the way for the moment |
14 | 26 | mv .pykk ../ |
15 | | - git clone $FIRMWARE_REPO --depth 1 -b master . |
| 27 | +
|
| 28 | + # Clone firmware repository (expects $FIRMWARE_REPO env var) |
| 29 | + git clone --depth 1 -b master "$FIRMWARE_REPO" . |
| 30 | +
|
| 31 | + # Initialise firmware submodules |
16 | 32 | git submodule update --init --recursive |
| 33 | +
|
| 34 | + # Replace the vendor copy with our freshly–cloned python-keepkey |
17 | 35 | rm -rf deps/python-keepkey |
18 | 36 | mv ../.pykk deps/python-keepkey |
| 37 | +
|
| 38 | + # Pull python-keepkey submodules too |
19 | 39 | cd deps/python-keepkey |
20 | 40 | git submodule update --init --recursive |
| 41 | + cd ../../.. |
| 42 | +
|
| 43 | + # ──────────────────────────────────────────────────────────────── |
| 44 | + # 3) Build the Docker-based emulator tests |
| 45 | + # ──────────────────────────────────────────────────────────────── |
21 | 46 | - setup_remote_docker |
| 47 | + |
22 | 48 | - run: |
23 | | - name: Emulator Tests |
| 49 | + name: Emulator tests |
24 | 50 | command: | |
25 | 51 | pushd ./scripts/emulator |
26 | | - set +e |
| 52 | + set +e # don’t exit on first failure |
27 | 53 | docker-compose up --build firmware-unit |
28 | 54 | docker-compose up --build python-keepkey |
29 | 55 | set -e |
| 56 | +
|
| 57 | + # Collect JUnit / pytest XML results |
30 | 58 | mkdir -p ../../test-reports |
31 | 59 | docker cp "$(docker-compose ps -q firmware-unit)":/kkemu/test-reports/. ../../test-reports/ |
32 | 60 | docker cp "$(docker-compose ps -q python-keepkey)":/kkemu/test-reports/. ../../test-reports/ |
33 | 61 | popd |
34 | | - [ "$(cat test-reports/python-keepkey/status)$(cat test-reports/firmware-unit/status)" == "00" ] || exit 1 |
| 62 | +
|
| 63 | + # Fail job if either container reported non-zero status |
| 64 | + [ "$(cat test-reports/python-keepkey/status)$(cat test-reports/firmware-unit/status)" = "00" ] || exit 1 |
| 65 | +
|
35 | 66 | - store_test_results: |
36 | 67 | path: test-reports |
| 68 | + |
| 69 | +# ────────────────────────────────────────────────────────────────────── |
37 | 70 | workflows: |
38 | 71 | version: 2 |
39 | 72 | emulator: |
40 | 73 | jobs: |
41 | 74 | - emulator-build-test |
42 | | - |
|
0 commit comments