Skip to content

Commit b1d4240

Browse files
Merge pull request #1 from devshift-stack/claude/analyze-repo-improvements-804M2
Analyze repository for improvements and bugs
2 parents 21922a5 + 53de5ea commit b1d4240

14 files changed

Lines changed: 2045 additions & 20 deletions

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['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@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Cache pip dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
37+
- name: Run linting (ruff)
38+
run: |
39+
pip install ruff
40+
ruff check agents/ tests/ --ignore E501
41+
42+
- name: Run type checking (mypy)
43+
run: |
44+
pip install mypy types-PyYAML
45+
mypy agents/agent_log_scorer.py --ignore-missing-imports || true
46+
47+
- name: Run tests with coverage
48+
run: |
49+
pytest tests/ -v --cov=agents --cov-report=xml --cov-report=term-missing
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v4
53+
with:
54+
file: ./coverage.xml
55+
fail_ci_if_error: false
56+
57+
integration-test:
58+
runs-on: ubuntu-latest
59+
needs: test
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: '3.11'
68+
69+
- name: Install dependencies
70+
run: |
71+
pip install -r requirements.txt
72+
73+
- name: Run sample analysis
74+
run: |
75+
python agents/agent_log_scorer.py
76+
77+
- name: Run batch analysis
78+
run: |
79+
python agents/agent_log_scorer.py --batch tests/scorecards/ --stats
80+
81+
- name: Generate HTML report
82+
run: |
83+
python agents/agent_log_scorer.py --batch tests/scorecards/ --html report.html
84+
85+
- name: Upload HTML report
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: html-report
89+
path: report.html
90+
91+
security-scan:
92+
runs-on: ubuntu-latest
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Set up Python
98+
uses: actions/setup-python@v5
99+
with:
100+
python-version: '3.11'
101+
102+
- name: Install bandit
103+
run: pip install bandit
104+
105+
- name: Run security scan
106+
run: |
107+
bandit -r agents/ -ll || true

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-json
9+
- id: check-added-large-files
10+
args: ['--maxkb=500']
11+
- id: check-merge-conflict
12+
- id: detect-private-key
13+
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.1.9
16+
hooks:
17+
- id: ruff
18+
args: [--fix, --ignore=E501]
19+
- id: ruff-format
20+
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.8.0
23+
hooks:
24+
- id: mypy
25+
additional_dependencies: [types-PyYAML]
26+
args: [--ignore-missing-imports]
27+
files: ^agents/
28+
29+
- repo: local
30+
hooks:
31+
- id: pytest
32+
name: pytest
33+
entry: pytest tests/ -v --tb=short
34+
language: system
35+
pass_filenames: false
36+
always_run: true
37+
stages: [commit]

0 commit comments

Comments
 (0)