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:
@@ -12,6 +12,9 @@ import json
|
||||
import sys
|
||||
|
||||
A = "https://git.protopeer.com/peptide-repo/peptide-e2e/.gitea/actions"
|
||||
# CI image with PHP 8.1/8.2/8.3 + Composer preinstalled (peptide-e2e/ci-image).
|
||||
# Without it setup-php bootstraps a compiler toolchain on every job (5-20 min).
|
||||
CI_IMAGE = "git.protopeer.com/peptide-repo/ci-php:2026-10"
|
||||
DEFAULTS = {"tests": "stubs", "has_js": False, "line_limit_paths": "includes",
|
||||
"enforce_300": True, "phpcs_autofix": True, "audit": True,
|
||||
"php_versions": ["8.1", "8.2", "8.3"], "extras": []}
|
||||
@@ -24,10 +27,8 @@ EXTRAS = {
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
coverage: none
|
||||
- name: Use PHP 8.1 (preinstalled in the CI image)
|
||||
run: update-alternatives --set php /usr/bin/php8.1 && php -v | head -1
|
||||
# Fails if any PRAUTOBLOGGER_* constant referenced in shipped PHP is neither
|
||||
# defined in prautoblogger.php nor guarded by defined() (v0.19.0 incident class).
|
||||
- run: php scripts/check-constants.php
|
||||
@@ -244,7 +245,9 @@ jobs:
|
||||
with:
|
||||
token: ${{{{ secrets.GITHUB_TOKEN }}}}
|
||||
""")
|
||||
return "".join(out)
|
||||
return "".join(out).replace(
|
||||
" runs-on: ubuntu-latest\n",
|
||||
f" runs-on: ubuntu-latest\n container: {CI_IMAGE}\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user