From bc7f751861dc63f49c3484b70d321621d6c96673 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 30 Jan 2026 11:20:56 +0100 Subject: [PATCH] ci, coldcard: clone once Avoids spurious CI failures by not re-cloning the large repo with many submodules in every test job. Additionally, stip .git folder(s) for all devices to shrink archives. --- .github/actions/build-sim/action.yml | 8 ++++++++ .github/actions/install-sim/action.yml | 13 ++++--------- .github/sim-build-map.json | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/actions/build-sim/action.yml b/.github/actions/build-sim/action.yml index 44aa589a2..2968a9f40 100644 --- a/.github/actions/build-sim/action.yml +++ b/.github/actions/build-sim/action.yml @@ -36,6 +36,14 @@ runs: cd test ./setup_environment.sh --"${{ inputs.name }}" cd .. + + # Remove .git directories to shrink the archive + for p in ${{ inputs.paths }}; do + # Skip speculos: it uses setuptools_scm which requires .git for version detection + if [[ "$p" != *speculos* ]]; then + find "$p" -name ".git" -type d -exec rm -rf {} + 2>/dev/null || true + fi + done tar -czf "${{ inputs.archive }}.tar.gz" ${{ inputs.paths }} - uses: actions/upload-artifact@v4 diff --git a/.github/actions/install-sim/action.yml b/.github/actions/install-sim/action.yml index 9e9e14e4a..261584960 100644 --- a/.github/actions/install-sim/action.yml +++ b/.github/actions/install-sim/action.yml @@ -20,18 +20,13 @@ runs: - if: inputs.device == 'coldcard' shell: bash - env: - # Keep in sync with test/setup_environment.sh - COLDCARD_VERSION: "2025-09-30T1238-v5.4.4" run: | apt-get update apt-get install -y libpcsclite-dev libusb-1.0-0 swig - git config --global user.email "ci@ci.com" - git config --global user.name "ci" - # Note: cannot use --shallow-submodules because lwip submodule on git.savannah.gnu.org doesn't support it - pushd test/work; git clone --recursive --depth 1 --branch ${COLDCARD_VERSION} https://github.com/Coldcard/firmware.git; popd - tar -xvf coldcard-mpy.tar.gz - pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd + + # Extract the archive - this includes the full firmware directory + tar -xvf coldcard-firmware.tar.gz + poetry run pip install -r test/work/firmware/requirements.txt pip install -r test/work/firmware/requirements.txt poetry run pip install pysdl2-dll diff --git a/.github/sim-build-map.json b/.github/sim-build-map.json index 24874d212..c5ad49fb0 100644 --- a/.github/sim-build-map.json +++ b/.github/sim-build-map.json @@ -4,7 +4,7 @@ { "name": "trezor-t", "archive": "trezor-firmware", "paths": "test/work/trezor-firmware" } ], "coldcard": [ - { "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" } + { "name": "coldcard", "archive": "coldcard-firmware", "paths": "test/work/firmware" } ], "bitbox": [ { "name": "bitbox01", "archive": "mcu", "paths": "test/work/mcu" },