ci(gitea): run CI in a prebuilt PHP image instead of setup-php bootstrap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AqpXh3hQMMaC74pTjFq4it
This commit is contained in:
peptiderepo-ops
2026-10-24 09:49:14 +00:00
parent 507f8addab
commit 1888122a74
7 changed files with 74 additions and 8 deletions

15
ci-image/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
# peptide-ci-php: Gitea runner image with PHP 8.1/8.2/8.3 + Composer preinstalled.
# Why: shivammathur/setup-php treats the stock runner image as a bare self-hosted
# box and apt-installs a whole compiler toolchain on every job (~5-10 min each).
# Built into the gitea-dind daemon by ci-image/build.sh; runner label `peptide-php`.
FROM docker.gitea.com/runner-images@sha256:fd911d7417bfbf0f454530e447da95b58001e1df41bbc5e1a8dd35d432575aae
RUN set -eux; export DEBIAN_FRONTEND=noninteractive; \
apt-get update; apt-get install -y --no-install-recommends software-properties-common gnupg unzip mariadb-client; \
add-apt-repository -y ppa:ondrej/php; apt-get update; \
for v in 8.1 8.2 8.3; do \
apt-get install -y --no-install-recommends php$v-cli php$v-common php$v-mbstring php$v-xml php$v-curl php$v-zip php$v-mysql php$v-intl php$v-bcmath php$v-gd; \
done; \
update-alternatives --set php /usr/bin/php8.3; \
curl -fsSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; \
composer --version; php8.1 -v | head -1; php8.2 -v | head -1; php8.3 -v | head -1; \
rm -rf /var/lib/apt/lists/*

6
ci-image/build.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# Build peptide-ci-php into the gitea-dind daemon the shared runner uses.
set -e
TAG=peptide-ci-php:2026-10
docker exec -i gitea-dind docker build -t "$TAG" - < "$(dirname "$0")/Dockerfile"
docker exec gitea-dind docker image inspect "$TAG" --format '{{.Id}} {{.Size}}'