mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
CI: add code-size check for files crossing LOC threshold (#12810)
* CI: add code-size check for files crossing LOC threshold * feat(ci): add duplicate function detection to CI code-size check The --compare-to mode now also detects new duplicate function names introduced by a PR. Uses git diff to scope checks to changed files only, keeping CI fast. * fix(ci): address review feedback for code-size check - Validate git ref upfront; exit 2 if ref doesn't exist - Distinguish 'file missing at ref' from genuine git errors - Explicitly fetch base branch ref in CI workflow - Raise threshold from 700 to 1000 lines * fix(ci): exclude Swabble, skills, .pi from code analysis * update gitignore for pycache * ci: make code-size check informational (no failure on violations)
This commit is contained in:
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
@@ -386,6 +386,31 @@ jobs:
|
||||
- name: Run ${{ matrix.task }}
|
||||
run: ${{ matrix.command }}
|
||||
|
||||
# Check for files that grew past LOC threshold in this PR (delta-only).
|
||||
code-size:
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Fetch base branch
|
||||
run: git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
|
||||
|
||||
- name: Check code file sizes
|
||||
run: |
|
||||
python scripts/analyze_code_files.py \
|
||||
--compare-to origin/${{ github.base_ref }} \
|
||||
--threshold 1000
|
||||
|
||||
secrets:
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user