Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqpXh3hQMMaC74pTjFq4it Gitea 1.25 cannot run reusable workflows (workflow_call), so the logic of deploy-app.yml, smoke.yml and ci.yml moves into composite actions under .gitea/actions/, and each repo gets a thin pipeline rendered by tools/gitea-pipeline/render.py from repos.json. .github/workflows is left untouched (Gitea ignores it once .gitea/workflows exists).
31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
name: CI - 300-line rule
|
|
description: Fail if any tracked *.php under the given paths exceeds 300 lines (estate hard rule).
|
|
inputs:
|
|
paths:
|
|
required: false
|
|
default: includes
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Check for PHP files over 300 lines
|
|
shell: bash
|
|
env:
|
|
PATHS: ${{ inputs.paths }}
|
|
run: |
|
|
set -e
|
|
OFFENDERS=""
|
|
for DIR in $PATHS; do
|
|
if [ ! -e "$DIR" ]; then echo "Warning: path '$DIR' does not exist - skipping."; continue; fi
|
|
while IFS= read -r FILE; do
|
|
[ -z "$FILE" ] && continue
|
|
LINES=$(wc -l < "$FILE")
|
|
if [ "$LINES" -gt 300 ]; then OFFENDERS="${OFFENDERS}${LINES} lines: ${FILE}\n"; fi
|
|
done < <(git ls-files -- "$DIR" | grep '\.php$' || true)
|
|
done
|
|
if [ -n "$OFFENDERS" ]; then
|
|
echo "::error::Files exceeding 300-line limit (estate hard rule):"
|
|
printf "%b" "$OFFENDERS"
|
|
exit 1
|
|
fi
|
|
echo "All tracked PHP files under '$PATHS' are within the 300-line limit."
|