Skip to content

Commit 80e0162

Browse files
committed
ci: add GitHub Actions workflow for automated code quality checks
- Create CI pipeline testing Python 3.8-3.12 compatibility - Add automated Black, isort, Flake8, and MyPy checks - Include import structure validation for all modules - Set up continuous integration for pull requests and pushes - Enable early detection of code quality issues
1 parent 54909bd commit 80e0162

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
9+
jobs:
10+
code-quality:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install black flake8 mypy isort
28+
pip install -r requirements.txt
29+
30+
- name: Run Black (Code Formatting)
31+
run: black --check --diff .
32+
33+
- name: Run isort (Import Sorting)
34+
run: isort --check-only --diff .
35+
36+
- name: Run Flake8 (Linting)
37+
run: flake8 . --max-line-length=88 --ignore=E203,W503 --exclude=.venv,venv,__pycache__,.git
38+
39+
- name: Run MyPy (Type Checking)
40+
run: mypy . --ignore-missing-imports --no-strict-optional
41+
continue-on-error: true # Allow MyPy to fail without stopping the workflow
42+
43+
- name: Test Import Structure
44+
run: |
45+
python -c "import coderag.config; print('✓ Config import successful')"
46+
python -c "import coderag.embeddings; print('✓ Embeddings import successful')"
47+
python -c "import coderag.index; print('✓ Index import successful')"
48+
python -c "import coderag.search; print('✓ Search import successful')"
49+
python -c "import coderag.monitor; print('✓ Monitor import successful')"
50+
env:
51+
OPENAI_API_KEY: dummy-key-for-testing

0 commit comments

Comments
 (0)