Skip to content

feat!: DeepTab v2 API with split-config design (#400) #59

feat!: DeepTab v2 API with split-config design (#400)

feat!: DeepTab v2 API with split-config design (#400) #59

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: pr-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-lint-${{ runner.os }}-3.10-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install --with dev
- name: Run ruff check
run: poetry run ruff check .
- name: Run ruff format check
run: poetry run ruff format --check .
typecheck:
name: Type check (pyright)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-typecheck-${{ runner.os }}-3.10-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install --with dev
- name: Run pyright
run: poetry run pyright
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-build-${{ runner.os }}-3.10-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install --only main
- name: Build package
run: poetry build
- name: Check package
run: |
python -m pip install --upgrade twine
twine check dist/*
tests:
name: Tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-tests-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Run unit tests
run: poetry run pytest tests/ -v
smoke:
name: Smoke tests (Python 3.12, ubuntu)
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-smoke-${{ runner.os }}-3.12-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Run smoke tests
run: poetry run pytest tests/ -v -m smoke --tb=short
coverage:
name: Coverage (stable modules)
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: pipx install poetry
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-coverage-${{ runner.os }}-3.12-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Run tests with coverage
run: |
poetry run pytest tests/ \
--cov=deeptab \
--cov-branch \
--cov-report=term-missing \
--cov-report=xml:coverage.xml \
-q
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 30
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false