File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,14 +18,25 @@ runs:
1818 apt-get install -y libsdl2-image-2.0-0 libusb-1.0-0
1919 tar -xvf trezor-firmware.tar.gz
2020
21+ # Coldcard: download seeded firmware (seed job must run earlier)
22+ - name : Download seeded Coldcard firmware
23+ if : inputs.device == 'coldcard'
24+ uses : actions/download-artifact@v4
25+ with :
26+ name : coldcard-firmware-src
27+ path : test/work/firmware
28+
2129 - if : inputs.device == 'coldcard'
2230 shell : bash
2331 run : |
2432 apt-get update
2533 apt-get install -y libpcsclite-dev libusb-1.0-0 swig
2634 git config --global user.email "ci@ci.com"
2735 git config --global user.name "ci"
28- pushd test/work; git clone --recursive https://github.com/Coldcard/firmware.git; popd
36+ pushd test/work
37+ if [ ! -d "firmware" ]; then
38+ git clone --recursive https://github.com/Coldcard/firmware.git
39+ popd
2940 tar -xvf coldcard-mpy.tar.gz
3041 pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd
3142 poetry run pip install -r test/work/firmware/requirements.txt
Original file line number Diff line number Diff line change @@ -119,9 +119,13 @@ jobs:
119119 # Trezor T binaries don't need this.
120120 runs-on : ubuntu-22.04
121121
122+ coldcard-firmware-seed :
123+ uses : ./.github/workflows/coldcard-firmware-seed.yml
124+
125+ # Use the generic sim-builder with a Coldcard seed dependency
122126 sim-builder-coldcard :
123127 name : Coldcard sim builder
124- needs : prepare-sim-matrices
128+ needs : [ prepare-sim-matrices, coldcard-firmware-seed]
125129 uses : ./.github/workflows/sim-builder.yml
126130 with :
127131 sim : coldcard
Original file line number Diff line number Diff line change 1+ name : Coldcard Firmware Seed
2+ on :
3+ workflow_call :
4+
5+ jobs :
6+ seed :
7+ name : Seed Coldcard firmware (once per run)
8+ runs-on : ubuntu-22.04
9+ steps :
10+ - uses : actions/checkout@v4
11+
12+ - name : Clone Coldcard firmware (with submodules)
13+ shell : bash
14+ run : |
15+ set -euo pipefail
16+ mkdir -p test/work
17+ pushd test/work
18+ git clone --recursive https://github.com/Coldcard/firmware.git
19+ popd
20+
21+ - name : Upload seeded repo as artifact
22+ uses : actions/upload-artifact@v4
23+ with :
24+ name : coldcard-firmware-src
25+ path : test/work/firmware
Original file line number Diff line number Diff line change 2323 include : ${{ fromJSON(inputs.include) }}
2424 steps :
2525 - uses : actions/checkout@v4
26+
27+ # Coldcard: download seeded firmware (seed job must run earlier)
28+ - name : Download seeded Coldcard firmware
29+ if : ${{ inputs.sim == 'coldcard' }}
30+ uses : actions/download-artifact@v4
31+ with :
32+ name : coldcard-firmware-src
33+ path : test/work/firmware
34+
2635 - uses : ./.github/actions/build-sim
2736 with :
2837 name : ${{ matrix.name }}
Original file line number Diff line number Diff line change @@ -133,30 +133,22 @@ if [[ -n ${build_coldcard} ]]; then
133133 coldcard_setup_needed=true
134134 else
135135 cd firmware
136- git reset --hard HEAD~3 # Undo git-am for checking and updating
137- git fetch
138-
139- # Determine if we need to pull. From https://stackoverflow.com/a/3278427
140- UPSTREAM=${1:- ' @{u}' }
141- LOCAL=$( git rev-parse @)
142- REMOTE=$( git rev-parse " $UPSTREAM " )
143- BASE=$( git merge-base @ " $UPSTREAM " )
136+ # Ensure repo matches upstream (handles seeded artifact without local commits)
137+ git fetch origin
138+ git reset --hard origin/master
139+ coldcard_setup_needed=true
144140
145- if [ $LOCAL = $REMOTE ]; then
146- echo " Up-to-date"
147- elif [ $LOCAL = $BASE ]; then
148- git pull
149- coldcard_setup_needed=true
150- fi
141+ # No additional pull needed; hard-reset above already synced to upstream
151142 fi
152- # Apply patch to make simulator work in linux environments
153- git am ../../data/coldcard-multisig.patch
154143
155144 # Build the simulator. This is cached, but it is also fast
156145 poetry run pip install -r requirements.txt
157146 pip install -r requirements.txt
158147 cd unix
159148 if [ " $coldcard_setup_needed " == true ] ; then
149+ # Apply patch to make simulator work in linux environments
150+ git am ../../../data/coldcard-multisig.patch
151+
160152 pushd ../external/micropython/mpy-cross/
161153 make
162154 popd
You can’t perform that action at this time.
0 commit comments