-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.49 KB
/
pr-validation.yml
File metadata and controls
56 lines (46 loc) · 1.49 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
52
53
54
55
56
name: PR Validation
on:
pull_request:
branches: [main]
jobs:
validate:
name: Lint, Compile & Contract Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install ruff pytest
- name: Ruff lint check
run: ruff check .
- name: Python syntax check (py_compile)
run: |
python -c "
import pathlib, py_compile, sys
errors = []
for p in pathlib.Path('.').rglob('*.py'):
if '.venv' in p.parts:
continue
try:
py_compile.compile(str(p), doraise=True)
except py_compile.PyCompileError as e:
errors.append(str(e))
if errors:
print(f'Syntax errors in {len(errors)} file(s):')
for err in errors:
print(f' {err}')
sys.exit(1)
print('All Python files compile successfully.')
"
- name: Root doc contract checks
run: python tools/check_root_docs.py
- name: Level index contract checks
run: python tools/check_level_index_contract.py
- name: Elite track contract checks
run: python tools/check_elite_track_contract.py
- name: Modality hub link validation
run: python tools/check_modality_hubs.py