Skip to content

Commit 82b1c49

Browse files
SjorsGPT-5 (Preview)
andcommitted
ci: clone coldcard repo only once
Co-authored-by: GPT-5 (Preview) <gpt5@example.com>
1 parent 4f2af1b commit 82b1c49

File tree

4 files changed

+72
-5
lines changed

4 files changed

+72
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,14 @@ jobs:
118118
# Trezor T binaries don't need this.
119119
runs-on: ubuntu-22.04
120120

121+
coldcard-firmware-seed:
122+
uses: ./.github/workflows/coldcard-firmware-seed.yml
123+
124+
# Use the coldcard-specialized builder (downloads the seeded artifact)
121125
sim-builder-coldcard:
122-
needs: prepare-sim-matrices
123-
uses: ./.github/workflows/sim-builder.yml
126+
needs: [prepare-sim-matrices, coldcard-firmware-seed]
127+
uses: ./.github/workflows/sim-builder-coldcard.yml
124128
with:
125-
sim: coldcard
126129
include: ${{ needs.prepare-sim-matrices.outputs.coldcard }}
127130
runs-on: ubuntu-22.04
128131

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
git clone --recursive https://github.com/Coldcard/firmware.git test/work/firmware
18+
git -C test/work/firmware submodule sync --recursive
19+
git -C test/work/firmware -c protocol.version=2 submodule update --init --recursive --jobs 8
20+
21+
- name: Apply HWI patch
22+
shell: bash
23+
run: |
24+
set -euo pipefail
25+
git config --global user.email "ci@ci.com"
26+
git config --global user.name "ci"
27+
git -C test/work/firmware am ../../data/coldcard-multisig.patch
28+
29+
- name: Upload seeded repo as artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: coldcard-firmware-src
33+
path: test/work/firmware
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Coldcard Simulator Builder
2+
on:
3+
workflow_call:
4+
inputs:
5+
include:
6+
required: true
7+
type: string
8+
runs-on:
9+
required: false
10+
type: string
11+
default: ubuntu-22.04
12+
13+
jobs:
14+
build-simulator:
15+
name: coldcard sim builder
16+
runs-on: ${{ inputs.runs-on }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include: ${{ fromJSON(inputs.include) }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Download seeded Coldcard firmware
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: coldcard-firmware-src
28+
path: test/work/firmware
29+
30+
- uses: ./.github/actions/build-sim

test/setup_environment.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,15 @@ if [[ -n ${build_coldcard} ]]; then
149149
coldcard_setup_needed=true
150150
fi
151151
fi
152-
# Apply patch to make simulator work in linux environments
153-
git am ../../data/coldcard-multisig.patch
154152

155153
# Build the simulator. This is cached, but it is also fast
156154
poetry run pip install -r requirements.txt
157155
pip install -r requirements.txt
158156
cd unix
159157
if [ "$coldcard_setup_needed" == true ] ; then
158+
# Apply patch to make simulator work in linux environments
159+
git am ../../../data/coldcard-multisig.patch
160+
160161
pushd ../external/micropython/mpy-cross/
161162
make
162163
popd

0 commit comments

Comments
 (0)