Merge pull request #3 from project-delphi/feature/add-ci-cd #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |