Skip to content

Commit 923ccc0

Browse files
authored
Merge branch 'main' into self-update-version-mgmt
2 parents 1f4df25 + 4796d07 commit 923ccc0

24 files changed

+6358
-168
lines changed

.github/workflows/automation.yml

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,82 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12']
15+
1316
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
1821
with:
19-
python-version: '3.11'
20-
22+
python-version: ${{ matrix.python-version }}
23+
2124
- name: Install dependencies
2225
run: |
2326
python -m pip install --upgrade pip
24-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25-
27+
pip install -r requirements.txt
28+
pip install pytest pytest-cov pytest-mock
29+
2630
- name: Run tests
2731
run: |
28-
if [ -d tests ]; then
29-
python -m pytest tests/ || echo "Tests not yet implemented"
30-
else
31-
echo "No tests directory found"
32-
fi
32+
python -m pytest test/ -v --cov=cortex --cov-report=xml --cov-report=term-missing
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v4
36+
if: matrix.python-version == '3.11'
37+
with:
38+
file: ./coverage.xml
39+
fail_ci_if_error: false
40+
41+
lint:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.11'
51+
52+
- name: Install linting tools
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install black pylint mypy
56+
57+
- name: Check formatting with black
58+
run: |
59+
black --check cortex/ || echo "::warning::Code formatting issues found. Run 'black cortex/' to fix."
60+
61+
- name: Lint with pylint
62+
run: |
63+
pylint cortex/ --exit-zero --output-format=text | tee pylint-report.txt
64+
score=$(tail -n 2 pylint-report.txt | head -n 1 | grep -oP '\d+\.\d+')
65+
echo "Pylint score: $score"
66+
67+
security:
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Set up Python
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: '3.11'
77+
78+
- name: Install security tools
79+
run: |
80+
python -m pip install --upgrade pip
81+
pip install bandit safety
82+
83+
- name: Run Bandit security linter
84+
run: |
85+
bandit -r cortex/ -ll -ii || echo "::warning::Security issues found. Please review."
86+
87+
- name: Check dependencies with safety
88+
run: |
89+
pip install -r requirements.txt
90+
safety check --full-report || echo "::warning::Vulnerable dependencies found."

.gitignore

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ venv.bak/
2020
# ==============================
2121
# Distribution / Packaging
2222
# ==============================
23-
__pycache__/
24-
*.py[cod]
25-
*$py.class
26-
*.so
2723
.Python
2824
build/
2925
develop-eggs/
@@ -150,3 +146,13 @@ ENV/
150146
.pytest_cache/
151147
.coverage
152148
htmlcov/
149+
*.out
150+
*~
151+
*.swo
152+
153+
# ==============================
154+
# Cortex specific
155+
# ==============================
156+
.cortex/
157+
*.yaml.bak
158+
/tmp/

0 commit comments

Comments
 (0)