-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (48 loc) · 1.78 KB
/
Copy pathcode-quality.yml
File metadata and controls
51 lines (48 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Code quality
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
report:
name: Quality report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install quality tools
# We do NOT install the package itself (it pulls grid2op / lightsim2grid
# which is heavy and not needed for static analysis). We only need
# the tools the report script shells out to.
run: |
python -m pip install --upgrade pip
python -m pip install radon>=6.0 vulture>=2.10 interrogate>=1.5 ruff>=0.5
- name: Run code quality report (non-strict)
# Always produce a full report, regardless of whether critical
# regressions are detected, so the GitHub step summary is populated
# on every run.
run: |
python scripts/code_quality_report.py \
--output code-quality-report.md \
--github-summary
- name: Upload report artifact
uses: actions/upload-artifact@v4
with:
name: code-quality-report
path: code-quality-report.md
if-no-files-found: error
- name: Enforce critical regressions (strict)
# This step re-runs in strict mode and *does* fail the job when any
# of the critical gates triggers: hardcoded absolute /home/<user>/...
# paths, duplicate config definitions.
# Non-critical metrics (ruff, vulture, complexity, bare TODOs) stay
# informational — they show up in the report but do not block PRs.
run: |
python scripts/code_quality_report.py --strict > /dev/null