Skip to content

Commit

Permalink
ci: Add Coldcard simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
jirijakes committed Feb 2, 2024
1 parent 98b4ea6 commit 57bd74e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ jobs:
- version: 1.48.0 # MSRV
features: miniscript
emulator:
- name: trezor
- name: ledger
# - name: trezor
# docker-params: '--network=host'
# - name: ledger
# docker-params: '--network=host'
- name: coldcard
docker-params: '-v /tmp:/tmp'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -70,7 +74,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha
- name: Run simulator image
run: docker run --name simulator --network=host hwi/${{ matrix.emulator.name }}_emulator &
run: docker run --name simulator ${{ matrix.emulator.docker-params }} hwi/${{ matrix.emulator.name }}_emulator &
- name: Install Python
uses: actions/setup-python@v4
with:
Expand Down
33 changes: 33 additions & 0 deletions ci/Dockerfile.coldcard
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3-slim

# Install required packages
RUN apt-get update
RUN apt-get install -y build-essential git python3 python3-pip libudev-dev gcc-arm-none-eabi libffi-dev swig libpcsclite-dev python-is-python3 autoconf libtool python3-venv pkg-config

# Prepare source code
RUN git clone --depth 1 --recursive -b 2024-01-18T1507-v6.2.2X https://github.com/Coldcard/firmware.git
WORKDIR /firmware
RUN git apply unix/linux_addr.patch

# Prepare virtual env
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install dependencies
RUN pip install -U pip setuptools
RUN pip install -r requirements.txt

# Build the Coldcard simulator
WORKDIR /firmware/external/micropython/mpy-cross/
RUN make
WORKDIR /firmware/unix
RUN make setup
RUN make ngu-setup
RUN make

# Run simulator
## for running on developers' machines
# USER 1000
VOLUME ["/tmp"]
CMD ["./headless.py"]

0 comments on commit 57bd74e

Please sign in to comment.