|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, dev, "feature/*", "fix/*", "chore/*", "cleanup/*"] |
| 6 | + pull_request: |
| 7 | + branches: [main, dev] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: "3.10" |
| 17 | + cache: "pip" |
| 18 | + - name: Install pre-commit |
| 19 | + run: pip install pre-commit |
| 20 | + - name: Run pre-commit |
| 21 | + run: pre-commit run --all-files --show-diff-on-failure |
| 22 | + |
| 23 | + build: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + python-version: ["3.10", "3.11", "3.12"] |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - name: Set up Python ${{ matrix.python-version }} |
| 31 | + uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: ${{ matrix.python-version }} |
| 34 | + cache: "pip" |
| 35 | + |
| 36 | + - name: Install Tesseract OCR |
| 37 | + run: | |
| 38 | + sudo apt-get update |
| 39 | + sudo apt-get install -y tesseract-ocr libtesseract-dev |
| 40 | +
|
| 41 | + - name: Install dependencies |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip |
| 44 | + pip install -e ".[nlp,ocr]" |
| 45 | + pip install -r requirements-dev.txt |
| 46 | +
|
| 47 | + - name: Run tests |
| 48 | + run: | |
| 49 | + python -m pytest tests/ --cov=datafog --cov-report=xml --cov-report=term |
| 50 | +
|
| 51 | + - name: Upload coverage |
| 52 | + uses: codecov/codecov-action@v4 |
| 53 | + with: |
| 54 | + file: ./coverage.xml |
| 55 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 56 | + |
| 57 | + wheel-size: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + - uses: actions/setup-python@v5 |
| 62 | + with: |
| 63 | + python-version: "3.10" |
| 64 | + cache: "pip" |
| 65 | + |
| 66 | + - name: Install build dependencies |
| 67 | + run: | |
| 68 | + python -m pip install --upgrade pip |
| 69 | + pip install build wheel |
| 70 | +
|
| 71 | + - name: Build wheel |
| 72 | + run: python -m build --wheel |
| 73 | + |
| 74 | + - name: Check wheel size |
| 75 | + run: python scripts/check_wheel_size.py |
0 commit comments