@@ -2,38 +2,80 @@ name: CI Pipeline
22
33on :
44 push :
5- branches : [ main, develop ]
5+ branches : [ main, develop, feature/* ]
66 pull_request :
77 branches : [ main, develop ]
88 workflow_dispatch :
99
1010jobs :
1111 test :
12+ name : Tests (Python ${{ matrix.python-version }})
1213 runs-on : ubuntu-latest
14+
15+ strategy :
16+ matrix :
17+ python-version : ["3.11", "3.12", "3.13"]
18+
1319 steps :
1420 - name : Checkout code
1521 uses : actions/checkout@v4
1622
17- - name : Set up Python 3.13
23+ - name : Set up Python ${{ matrix.python-version }}
1824 uses : actions/setup-python@v5
1925 with :
20- python-version : " 3.13 "
26+ python-version : ${{ matrix.python-version }}
2127 cache : ' pip'
2228
2329 - name : Install dependencies
2430 run : |
2531 python -m pip install --upgrade pip
2632 pip install -r requirements.txt
2733
28- - name : Run tests with coverage
34+ - name : Run unit tests with coverage
35+ env :
36+ USE_REAL_OPENSTACK : " False"
37+ ENVIRONMENT : " test"
38+ run : |
39+ pytest --cov=app --cov-report=term --cov-report=xml --cov-report=html
40+
41+ - name : Check coverage threshold
42+ run : |
43+ coverage report --fail-under=85
44+
45+ - name : Upload coverage reports to Codecov
46+ if : matrix.python-version == '3.13'
47+ uses : codecov/codecov-action@v4
48+ with :
49+ file : ./coverage.xml
50+ flags : unittests
51+ name : codecov-umbrella
52+ fail_ci_if_error : false
53+ token : ${{ secrets.CODECOV_TOKEN }}
54+
55+ lint :
56+ name : Code Quality Checks
57+ runs-on : ubuntu-latest
58+
59+ steps :
60+ - name : Checkout code
61+ uses : actions/checkout@v4
62+
63+ - name : Set up Python
64+ uses : actions/setup-python@v5
65+ with :
66+ python-version : " 3.13"
67+ cache : ' pip'
68+
69+ - name : Install dependencies
2970 run : |
30- pytest tests/ -v --cov=app --cov-report=term-missing
71+ python -m pip install --upgrade pip
72+ pip install -r requirements.txt
3173
3274 - name : Check code formatting (Black)
3375 run : black --check app/ tests/ main.py
3476
3577 - name : Run type checking (Mypy)
36- run : mypy app/ main.py
78+ run : mypy app/ main.py --ignore-missing-imports
3779
3880 - name : Run linting (Flake8)
39- run : flake8 app/ tests/ main.py --max-line-length=120
81+ run : flake8 app/ tests/ main.py --max-line-length=120 --extend-ignore=E203,W503
0 commit comments