diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f4470b..9491dbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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: diff --git a/ci/Dockerfile.coldcard b/ci/Dockerfile.coldcard new file mode 100644 index 0000000..210a938 --- /dev/null +++ b/ci/Dockerfile.coldcard @@ -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"]