Files
deploy_home/ansible/roles/gitea-actions/templates/Containerfile.platformio.j2
T
Bastian de Byl 9dfa812a80 gitea-actions: add PlatformIO CI image for Arduino-framework ESP32 builds
New opt-in job image localhost/gitea-ci-platformio:7.0.1 (pattern matches the
ESP-IDF image): PlatformIO core 6.1.19 with the espressif32@7.0.1 platform,
xtensa toolchain and Arduino framework pre-baked via a seed project so
ephemeral job containers download nothing. First consumer is
Skudak/esp32-web-interface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 16:59:57 -04:00

30 lines
1.5 KiB
Docker

# PlatformIO firmware job image (managed by ansible: roles/gitea-actions).
# For Arduino-framework ESP32 projects (e.g. Skudak/esp32-web-interface) that
# build with PlatformIO rather than raw ESP-IDF. Node is required by
# actions/checkout and other JS actions.
# The espressif32 platform, xtensa toolchain and Arduino framework are
# pre-baked into PLATFORMIO_CORE_DIR via a throwaway seed project so ephemeral
# job containers download nothing at build time. Versions are pinned to what
# was validated on hardware — bump pio_espressif32_version /
# platformio_core_version in defaults/main.yml to upgrade (the image tag
# tracks the platform version).
FROM python:3.12-slim-bookworm
ENV PLATFORMIO_CORE_DIR=/opt/platformio
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates unzip \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir platformio=={{ platformio_core_version }}
# Seed project mirroring the real projects' platformio.ini so `pio pkg install`
# pulls the platform + toolchain + framework packages into the core dir.
RUN mkdir -p /tmp/seed/src \
&& printf '[env:seed]\nplatform = espressif32@{{ pio_espressif32_version }}\nframework = arduino\nboard = esp32dev\nboard_build.filesystem = spiffs\n' > /tmp/seed/platformio.ini \
&& pio pkg install -d /tmp/seed \
&& rm -rf /tmp/seed \
&& chmod -R a+rX ${PLATFORMIO_CORE_DIR}