Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add Coldcard simulator #95

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ jobs:
rust:
- version: 1.66.1 # STABLE
features: miniscript
- version: 1.48.0 # MSRV
features: miniscript
# - 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 @@
# Ubuntu 23.04 uses gcc-12 by default
# In coldcard, micropython does not build with gcc-13
FROM ubuntu:23.04

# Install required packages
RUN apt-get update && 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 && apt-get clean

# Prepare source code
RUN git clone --depth 1 --recursive -b 2024-01-18T1507-v6.2.2X https://github.com/Coldcard/firmware.git
WORKDIR /firmware/external/libngu/libs/bech32
RUN git apply ../../bech32.patch
WORKDIR /firmware
RUN git apply unix/linux_addr.patch && rm -rf .git && sed -i "/git/d" unix/Makefile && sed -i "/git/d" external/libngu/Makefile

# 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 && pip install -r requirements.txt

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

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