Skip to content

feat(ledger, telemetry): fix shallow copy risks, locking flaws, and … #8

feat(ledger, telemetry): fix shallow copy risks, locking flaws, and …

feat(ledger, telemetry): fix shallow copy risks, locking flaws, and … #8

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
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 }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev,all,locking]
- name: Lint with ruff
run: |
ruff check .
- name: Verify formatting with ruff
run: |
ruff format --check .
- name: Format check with black
run: |
black --check --diff .
- name: Type check with mypy (strict on src)
run: |
python -m mypy --config-file pyproject.toml src/carbon_ops
- name: Warn on unused type ignore comments
run: |
echo "Checking for unused # type: ignore comments..."
python -m mypy --warn-unused-ignores src/carbon_ops || true
- name: Security scan with Bandit
run: |
python -m bandit -c pyproject.toml -r src examples
- name: Test with pytest
run: |
pytest
- name: Generate coverage XML
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
coverage xml
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella