Skip to content

Update README.md

Update README.md #3

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main, enhance-pipeline ]
pull_request:
branches: [ main, enhance-pipeline ]
jobs:
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 isort mypy
pip install -r requirements.txt
- name: Check formatting with Black
run: black --check --line-length 120 src/ tests/
- name: Lint with Flake8
run: flake8 src/ tests/
- name: Check import sorting with isort
run: isort --check-only --profile black src/ tests/
- name: Type check with mypy
run: mypy src/
continue-on-error: true
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- 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
run: |
pytest tests/unit/ -v --cov=src --cov-report=xml --cov-report=term-missing
env:
PYTHONPATH: ${{ github.workspace }}
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run integration tests
run: |
pytest tests/integration/ -v -m integration
env:
PYTHONPATH: ${{ github.workspace }}
continue-on-error: true
format:
name: Auto-format Code
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install formatting tools
run: |
python -m pip install --upgrade pip
pip install black isort
- name: Format code with Black
run: black --line-length 120 src/ tests/
- name: Sort imports with isort
run: isort --profile black src/ tests/
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff --quiet && git diff --staged --quiet || (git add -A && git commit -m "style: auto-format code with black and isort [skip ci]")
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
if: success()