1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main, develop]
6+ pull_request :
7+ branches : [main]
8+
9+ concurrency :
10+ group : ci-${{ github.ref }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ test :
15+ name : Test & Quality Checks
16+ runs-on : ubuntu-latest
17+
18+ strategy :
19+ fail-fast : false
20+ matrix :
21+ python-version : ["3.13"]
22+
23+ steps :
24+ # -------------------------------------------------
25+ # Checkout
26+ # -------------------------------------------------
27+ - name : Checkout code
28+ uses : actions/checkout@v4
29+
30+ # -------------------------------------------------
31+ # Python setup
32+ # -------------------------------------------------
33+ - name : Set up Python
34+ uses : actions/setup-python@v5
35+ with :
36+ python-version : ${{ matrix.python-version }}
37+
38+ # -------------------------------------------------
39+ # Cache dependencies (speed)
40+ # -------------------------------------------------
41+ - name : Cache pip
42+ uses : actions/cache@v4
43+ with :
44+ path : ~/.cache/pip
45+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
46+ restore-keys : |
47+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
48+
49+ # -------------------------------------------------
50+ # Install dependencies
51+ # -------------------------------------------------
52+ - name : Install dependencies
53+ run : |
54+ python -m pip install --upgrade pip
55+ pip install -r requirements.txt
56+ pip install pytest flake8 black isort
57+
58+ # -------------------------------------------------
59+ # Lint (code quality)
60+ # -------------------------------------------------
61+ - name : Lint with flake8
62+ run : |
63+ flake8 src --max-line-length=100
64+
65+ # -------------------------------------------------
66+ # Format check
67+ # -------------------------------------------------
68+ - name : Check formatting (black)
69+ run : |
70+ black --check src
71+
72+ # -------------------------------------------------
73+ # Import sorting check
74+ # -------------------------------------------------
75+ - name : Check imports (isort)
76+ run : |
77+ isort --check-only src
78+
79+ # -------------------------------------------------
80+ # Run tests
81+ # -------------------------------------------------
82+ - name : Run tests
83+ env :
84+ PYTHONPATH : .
85+ run : |
86+ pytest -v
87+
88+ # -----------------------------------------------------
89+ # Optional: Security scan
90+ # -----------------------------------------------------
91+ security :
92+ name : Security Scan
93+ runs-on : ubuntu-latest
94+ needs : test
95+
96+ steps :
97+ - name : Checkout code
98+ uses : actions/checkout@v4
99+
100+ - name : Install security tools
101+ run : |
102+ pip install bandit
103+
104+ - name : Run Bandit
105+ run : |
106+ bandit -r src
0 commit comments