1+ name : Code Quality
2+
3+ env :
4+ COVERAGE_THRESHOLD : 50
5+ VULTURE_MIN_CONFIDENCE : 80
6+ MAIN_SCAN_PATHS : ' src calmlib tools tests'
7+ EXTRA_SCAN_PATHS : ' experiments'
8+ ALL_SCAN_PATHS : ' src calmlib tools experiments tests'
9+ COVERAGE_PATHS_FLAGS : ' --cov=src --cov=calmlib --cov=tools'
10+
11+ on :
12+ pull_request :
13+ types : [ opened, synchronize, reopened ]
14+
15+ jobs :
16+ ruff-check :
17+ name : Ruff
18+ runs-on : ubuntu-latest
19+ strategy :
20+ matrix :
21+ python-version : [ "3.13" ]
22+ steps :
23+ - uses : actions/checkout@v3
24+ - uses : ./.github/actions/setup-python-env
25+ with :
26+ python-version : ${{ matrix.python-version }}
27+
28+ - name : Run Ruff linter
29+ run : uv run ruff check --output-format=github ${{ env.MAIN_SCAN_PATHS }}
30+
31+ - name : Run Ruff formatter check
32+ run : uv run ruff format --check --diff ${{ env.MAIN_SCAN_PATHS }}
33+
34+ dead-code-check :
35+ name : Vulture
36+ runs-on : ubuntu-latest
37+ strategy :
38+ matrix :
39+ python-version : [ "3.13" ]
40+ steps :
41+ - uses : actions/checkout@v3
42+ - uses : ./.github/actions/setup-python-env
43+ with :
44+ python-version : ${{ matrix.python-version }}
45+
46+ - name : Run Vulture dead code detector
47+ run : uv run vulture --min-confidence ${{ env.VULTURE_MIN_CONFIDENCE }} ${{ env.MAIN_SCAN_PATHS }}
48+
49+ coverage :
50+ name : Coverage Report
51+ runs-on : ubuntu-latest
52+ strategy :
53+ matrix :
54+ python-version : [ "3.13" ]
55+ steps :
56+ - uses : actions/checkout@v3
57+ - uses : ./.github/actions/setup-python-env
58+ with :
59+ python-version : ${{ matrix.python-version }}
60+
61+ - name : Run coverage analysis
62+ run : |
63+ uv run pytest ${{ env.ALL_SCAN_PATHS }} \
64+ ${{ env.COVERAGE_PATHS_FLAGS }} \
65+ --cov-report=xml \
66+ --cov-report=term \
67+ --cov-fail-under=${{ env.COVERAGE_THRESHOLD }}
68+
69+ # - name: Upload coverage to Codecov (optional)
70+ # uses: codecov/codecov-action@v3
71+ # if: always()
72+ # with:
73+ # file: ./coverage.xml
74+ # fail_ci_if_error: false
75+
76+ experiments-check :
77+ name : Experiments Report (Non-blocking)
78+ runs-on : ubuntu-latest
79+ continue-on-error : true # This makes the job non-blocking
80+ strategy :
81+ matrix :
82+ python-version : [ "3.13" ]
83+ steps :
84+ - uses : actions/checkout@v3
85+ - uses : ./.github/actions/setup-python-env
86+ with :
87+ python-version : ${{ matrix.python-version }}
88+
89+ - name : Run Ruff on experiments (non-blocking)
90+ run : |
91+ echo "🧪 Running quality checks on experiments (non-blocking)..."
92+ uv run ruff check --output-format=github ${{ env.EXTRA_SCAN_PATHS }} || echo "⚠️ Ruff found issues in experiments"
93+
94+ - name : Run Vulture on experiments (non-blocking)
95+ run : |
96+ uv run vulture --min-confidence 80 ${{ env.EXTRA_SCAN_PATHS }} || echo "⚠️ Vulture found dead code in experiments"
97+
98+ - name : Run basic tests on experiments (non-blocking)
99+ run : |
100+ if [ -d "${{ env.EXTRA_SCAN_PATHS }}" ]; then
101+ uv run pytest ${{ env.EXTRA_SCAN_PATHS }} --tb=short || echo "⚠️ Some experiment tests failed"
102+ else
103+ echo "📝 No experiments directory found"
104+ fi
0 commit comments