-
Notifications
You must be signed in to change notification settings - Fork 33
56 lines (45 loc) · 2 KB
/
code-quality.yml
File metadata and controls
56 lines (45 loc) · 2 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: Code Quality
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 mypy isort types-requests
pip install -r requirements.txt
- name: Run Black (Code Formatting)
run: black --check --diff . --exclude="/(build|dist|venv|env|\.venv|\.env|\.git|\.mypy_cache|\.pytest_cache|\.tox)/"
- name: Run isort (Import Sorting)
run: isort --check-only --diff . --skip-glob="**/build/**" --skip-glob="**/dist/**" --skip-glob="**/venv/**" --skip-glob="**/.venv/**"
- name: Run Flake8 (Linting)
run: flake8 . --max-line-length=88 --ignore=E203,W503 --exclude=.venv,venv,__pycache__,.git,build,dist
- name: Run MyPy (Type Checking)
run: mypy . --ignore-missing-imports --no-strict-optional --exclude="(build|dist|venv|env|\.venv|\.env|\.git|\.mypy_cache|\.pytest_cache|\.tox)/"
continue-on-error: false # Make MyPy a required check
- name: Test Import Structure
run: |
python -c "import coderag.config; print('✓ Config import successful')"
python -c "import coderag.embeddings; print('✓ Embeddings import successful')"
python -c "import coderag.index; print('✓ Index import successful')"
python -c "import coderag.search; print('✓ Search import successful')"
python -c "import coderag.monitor; print('✓ Monitor import successful')"
env:
OPENAI_API_KEY: dummy-key-for-testing