mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
feat(ci): code-size gates heavy jobs, re-enable --strict
This commit is contained in:
@@ -120,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
# Build dist once for Node-relevant changes and share it with downstream jobs.
|
# Build dist once for Node-relevant changes and share it with downstream jobs.
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
needs: [docs-scope, changed-scope]
|
needs: [docs-scope, changed-scope, code-size]
|
||||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
steps:
|
steps:
|
||||||
@@ -184,7 +184,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
install-check:
|
install-check:
|
||||||
needs: [docs-scope, changed-scope]
|
needs: [docs-scope, changed-scope, code-size]
|
||||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
steps:
|
steps:
|
||||||
@@ -238,7 +238,7 @@ jobs:
|
|||||||
pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
needs: [docs-scope, changed-scope]
|
needs: [docs-scope, changed-scope, code-size]
|
||||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
strategy:
|
strategy:
|
||||||
@@ -387,29 +387,35 @@ jobs:
|
|||||||
run: ${{ matrix.command }}
|
run: ${{ matrix.command }}
|
||||||
|
|
||||||
# Check for files that grew past LOC threshold in this PR (delta-only).
|
# Check for files that grew past LOC threshold in this PR (delta-only).
|
||||||
|
# On push events, all steps are skipped and the job passes (no-op).
|
||||||
|
# Heavy downstream jobs depend on this to fail fast on violations.
|
||||||
code-size:
|
code-size:
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: false
|
submodules: false
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: Fetch base branch
|
- name: Fetch base branch
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
run: git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
|
run: git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
|
||||||
|
|
||||||
- name: Check code file sizes
|
- name: Check code file sizes
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
python scripts/analyze_code_files.py \
|
python scripts/analyze_code_files.py \
|
||||||
--compare-to origin/${{ github.base_ref }} \
|
--compare-to origin/${{ github.base_ref }} \
|
||||||
--threshold 1000
|
--threshold 1000 \
|
||||||
|
--strict
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
@@ -437,7 +443,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
checks-windows:
|
checks-windows:
|
||||||
needs: [docs-scope, changed-scope, build-artifacts]
|
needs: [docs-scope, changed-scope, build-artifacts, code-size]
|
||||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
|
||||||
runs-on: blacksmith-4vcpu-windows-2025
|
runs-on: blacksmith-4vcpu-windows-2025
|
||||||
env:
|
env:
|
||||||
@@ -558,7 +564,7 @@ jobs:
|
|||||||
# running 4 separate jobs per PR (as before) starved the queue. One job
|
# running 4 separate jobs per PR (as before) starved the queue. One job
|
||||||
# per PR allows 5 PRs to run macOS checks simultaneously.
|
# per PR allows 5 PRs to run macOS checks simultaneously.
|
||||||
macos:
|
macos:
|
||||||
needs: [docs-scope, changed-scope]
|
needs: [docs-scope, changed-scope, code-size]
|
||||||
if: github.event_name == 'pull_request' && needs.docs-scope.outputs.docs_only != 'true' && needs.changed-scope.outputs.run_macos == 'true'
|
if: github.event_name == 'pull_request' && needs.docs-scope.outputs.docs_only != 'true' && needs.changed-scope.outputs.run_macos == 'true'
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -836,7 +842,7 @@ jobs:
|
|||||||
PY
|
PY
|
||||||
|
|
||||||
android:
|
android:
|
||||||
needs: [docs-scope, changed-scope]
|
needs: [docs-scope, changed-scope, code-size]
|
||||||
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_android == 'true')
|
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_android == 'true')
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
Reference in New Issue
Block a user