chore(deps): bump protobuf from 6.30.2 to 6.33.5 #176
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [main, dev, "feature/*", "fix/*", "chore/*", "cleanup/*"] | |
| pull_request: | |
| branches: [main, dev] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files --show-diff-on-failure | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| install-profile: ["core", "nlp", "nlp-advanced"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install base tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov coverage | |
| - name: Install dependencies (core) | |
| if: matrix.install-profile == 'core' | |
| run: | | |
| pip install -e ".[dev,cli]" | |
| - name: Install dependencies (nlp) | |
| if: matrix.install-profile == 'nlp' | |
| run: | | |
| pip install -e ".[dev,cli,nlp]" | |
| python -m spacy download en_core_web_sm | |
| - name: Install dependencies (nlp-advanced) | |
| if: matrix.install-profile == 'nlp-advanced' | |
| run: | | |
| pip install -e ".[dev,cli,nlp,nlp-advanced]" | |
| python -m spacy download en_core_web_sm | |
| - name: Run tests (core) | |
| if: matrix.install-profile == 'core' | |
| run: | | |
| pytest tests/ \ | |
| -m "not slow" \ | |
| --ignore=tests/test_gliner_annotator.py \ | |
| --ignore=tests/test_image_service.py \ | |
| --ignore=tests/test_ocr_integration.py \ | |
| --ignore=tests/test_spark_integration.py \ | |
| --ignore=tests/test_text_service_integration.py \ | |
| --cov=datafog \ | |
| --cov-branch \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing | |
| - name: Run tests (nlp) | |
| if: matrix.install-profile == 'nlp' | |
| run: | | |
| pytest tests/ \ | |
| -m "not slow" \ | |
| --ignore=tests/test_gliner_annotator.py \ | |
| --ignore=tests/test_image_service.py \ | |
| --ignore=tests/test_ocr_integration.py \ | |
| --ignore=tests/test_spark_integration.py \ | |
| --cov=datafog \ | |
| --cov-branch \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing | |
| - name: Run tests (nlp-advanced) | |
| if: matrix.install-profile == 'nlp-advanced' | |
| run: | | |
| pytest tests/ \ | |
| -m "not slow" \ | |
| --ignore=tests/test_detection_accuracy.py \ | |
| --ignore=tests/test_image_service.py \ | |
| --ignore=tests/test_ocr_integration.py \ | |
| --ignore=tests/test_spark_integration.py \ | |
| --cov=datafog \ | |
| --cov-branch \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing | |
| - name: Run detection accuracy corpus | |
| if: matrix.python-version == '3.11' && matrix.install-profile == 'nlp-advanced' | |
| run: | | |
| pytest tests/test_detection_accuracy.py \ | |
| -v --tb=short \ | |
| --cov=datafog \ | |
| --cov-branch \ | |
| --cov-append \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing | |
| - name: Enforce coverage thresholds | |
| if: matrix.python-version == '3.11' && matrix.install-profile == 'nlp-advanced' | |
| run: | | |
| python - <<'PY' | |
| import sys | |
| import xml.etree.ElementTree as ET | |
| root = ET.parse("coverage.xml").getroot() | |
| line_rate = float(root.attrib.get("line-rate", 0.0)) | |
| branch_rate = float(root.attrib.get("branch-rate", 0.0)) | |
| line_pct = line_rate * 100 | |
| branch_pct = branch_rate * 100 | |
| print(f"Line coverage: {line_pct:.2f}%") | |
| print(f"Branch coverage: {branch_pct:.2f}%") | |
| if line_pct < 85: | |
| print("Line coverage below 85% threshold.") | |
| sys.exit(1) | |
| if branch_pct < 75: | |
| print("Branch coverage below 75% threshold.") | |
| sys.exit(1) | |
| PY | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| flags: ${{ matrix.install-profile }}-py${{ matrix.python-version }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| wheel-size: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build wheel | |
| - name: Build wheel | |
| run: python -m build --wheel | |
| - name: Check wheel size | |
| run: python scripts/check_wheel_size.py |