Skip to content

feat[CI]: Expand CI to support Python version matrix and add coverage… #5

feat[CI]: Expand CI to support Python version matrix and add coverage…

feat[CI]: Expand CI to support Python version matrix and add coverage… #5

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run unit tests with coverage
env:
USE_REAL_OPENSTACK: "False"
ENVIRONMENT: "test"
run: |
pytest --cov=app --cov-report=term --cov-report=xml --cov-report=html
- name: Check coverage threshold
run: |
coverage report --fail-under=85
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check code formatting (Black)
run: black --check app/ tests/ main.py
- name: Run type checking (Mypy)
run: mypy app/ main.py --ignore-missing-imports
- name: Run linting (Flake8)
run: flake8 app/ tests/ main.py --max-line-length=120 --extend-ignore=E203,W503