Files
Andreas T Jonsson eb54b18404 ci(testdata): switch CI caching from file copy to git sparse-checkout
Previously the Docker image baked in .MOO test files and the CI copied
them into the workspace before running make testdata. This caused stale
test data on the CI when the test repos were updated, because fetch.py
skipped existing .MOO files without checking if the source was newer.

Changes:
- Dockerfile: replace COPY of .MOO/masks/metadata with sparse git clones
  of 8088 and v20 repos into /opt/testdata-cache/
- fetch.py: accept TESTDATA_CACHE env var for git cache dir, and add
  mtime check so existing .MOO files are re-extracted when .gz is newer
- .woodpecker/test.yaml: remove file-copy cache step, set TESTDATA_CACHE
  env var on the testdata step instead

This ensures CI always gets fresh test data via git pull + re-extraction
while keeping the fast path of not re-downloading unchanged repos.
2026-05-29 11:40:50 +02:00

39 lines
1.7 KiB
Docker

FROM debian:trixie
ARG BUTLER_URL="https://github.com/andreas-jonsson/butler-bin/raw/main/butler-linux-amd64.zip"
#ARG BUTLER_URL="https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default"
RUN apt update \
&& apt install -y build-essential bash git curl wget python3 python3-requests coffeescript 7zip unzip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt
# Pre-clone 8088 and V20 test repos for fast CI caching via git sparse-checkout.
# The fetch.py script will pull updates and extract .MOO files at build time.
RUN mkdir -p /opt/testdata-cache && \
git clone --depth 1 --filter=blob:none --sparse \
https://codeberg.org/virtualxt/8088 /opt/testdata-cache/8088 && \
git -C /opt/testdata-cache/8088 sparse-checkout set v2 v2_binary && \
git clone --depth 1 --filter=blob:none --sparse \
https://codeberg.org/virtualxt/v20 /opt/testdata-cache/v20 && \
git -C /opt/testdata-cache/v20 sparse-checkout set v1_native v1_native_binary
RUN curl -L -o butler.zip ${BUTLER_URL} && unzip butler.zip -d /opt/butler && rm butler.zip
RUN git clone https://github.com/emscripten-core/emsdk \
&& /opt/emsdk/emsdk install 3.1.74 && /opt/emsdk/emsdk activate 3.1.74
# ARM GNU Toolchain (aarch64-none-elf bare-metal for x86_64 Linux)
ARG ARM_TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-aarch64-none-elf.tar.xz"
RUN curl -L -o arm-toolchain.tar.xz ${ARM_TOOLCHAIN_URL} \
&& tar -xf arm-toolchain.tar.xz -C /opt \
&& rm arm-toolchain.tar.xz
# Circle library for Raspberry Pi bare-metal
RUN git clone https://codeberg.org/virtualxt/circle /opt/circle
WORKDIR /
ENV PATH="/opt/arm-gnu-toolchain-15.2.rel1-x86_64-aarch64-none-elf/bin:/opt/butler:/opt/emsdk:${PATH}"