|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - sam2_refactor |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - sam2_refactor |
| 11 | + - main |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + name: Test Python ${{ matrix.python-version }} |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + python-version: ["3.10", "3.11", "3.12"] |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v5 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + cache: 'pip' |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + python -m pip install --upgrade pip |
| 35 | + pip install pandas>=2.2.0 numpy>=1.26.0 --only-binary :all: |
| 36 | + pip install -e .[ci] |
| 37 | +
|
| 38 | + - name: Run unit tests |
| 39 | + run: | |
| 40 | + pytest tests/unit -v -m "not requires_casa" |
| 41 | +
|
| 42 | + - name: Run integration tests |
| 43 | + run: | |
| 44 | + pytest tests/integration -v -m "not requires_casa" |
| 45 | +
|
| 46 | + code-quality: |
| 47 | + name: Code Quality |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout code |
| 52 | + uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - name: Set up Python |
| 55 | + uses: actions/setup-python@v5 |
| 56 | + with: |
| 57 | + python-version: "3.12" |
| 58 | + cache: 'pip' |
| 59 | + |
| 60 | + - name: Install dependencies |
| 61 | + run: | |
| 62 | + python -m pip install --upgrade pip |
| 63 | + pip install black==24.1.1 ruff==0.1.15 isort==5.13.2 |
| 64 | +
|
| 65 | + - name: Check formatting with Black |
| 66 | + run: | |
| 67 | + black --check --line-length=100 src/ tests/ |
| 68 | +
|
| 69 | + # isort check disabled - pre-commit handles this locally |
| 70 | + # - name: Check import sorting with isort |
| 71 | + # run: | |
| 72 | + # isort --check-only --profile black --line-length=100 src/ tests/ |
| 73 | + |
| 74 | + - name: Auto-fix with Ruff |
| 75 | + run: | |
| 76 | + ruff check --fix src/ tests/ |
| 77 | +
|
| 78 | + - name: Report remaining Ruff issues (warning only) |
| 79 | + continue-on-error: true |
| 80 | + run: | |
| 81 | + ruff check src/ tests/ |
0 commit comments