Refactor merging documentation for clarity and usability (#220) #956
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
| # Continuous integration | |
| name: CI | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| paths: | |
| - "sleap_io/**" | |
| - "tests/**" | |
| - ".github/workflows/ci.yml" | |
| - "pyproject.toml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "sleap_io/**" | |
| - "tests/**" | |
| - ".github/workflows/ci.yml" | |
| - "pyproject.toml" | |
| jobs: | |
| # Lint with ruff | |
| lint: | |
| # This job runs: | |
| # | |
| # 1. Linting and formatting checks with ruff | |
| # | |
| # Note: This uses Google-style docstring convention | |
| # Ref: https://google.github.io/styleguide/pyguide.html | |
| name: Lint | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Run ruff checks | |
| run: | | |
| uv run ruff check sleap_io tests | |
| - name: Run ruff format check | |
| run: | | |
| uv run ruff format --check sleap_io tests | |
| # Tests with pytest | |
| tests: | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
| python: ["3.8", "3.13"] | |
| exclude: | |
| - os: "macos-latest" | |
| python: "3.8" | |
| - os: "windows-latest" | |
| python: "3.8" | |
| name: Tests (${{ matrix.os }}, Python ${{ matrix.python }}) | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Print environment info | |
| run: | | |
| uv run python --version | |
| uv run pip freeze | |
| - name: Install graphics dependencies on Ubuntu | |
| # https://github.com/conda-forge/opencv-feedstock/issues/401 | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: | | |
| sudo apt-get update && sudo apt-get install libglapi-mesa libegl-mesa0 libegl1 libopengl0 libgl1 libglx-mesa0 | |
| - name: Test with pytest (with coverage) | |
| run: | | |
| uv run pytest --cov=sleap_io --cov-report=xml --durations=-1 tests/ | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| fail_ci_if_error: true | |
| verbose: false | |
| token: ${{ secrets.CODECOV_TOKEN }} |