Skip to content

Add CI/CD workflow

Add CI/CD workflow #3

Workflow file for this run

name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov black isort
- name: Check formatting with black
run: |
black --check anomaly_detection/ tests/
- name: Check import sorting with isort
run: |
isort --check-only anomaly_detection/ tests/
- name: Run tests with coverage
run: |
pytest tests/ --cov=anomaly_detection --cov-report=xml -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: true