97 lines
2.5 KiB
YAML
97 lines
2.5 KiB
YAML
name: Check
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
pull_request:
|
|
branches: [main, dev]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint, format & type checks
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
# --seed gives the venv its own pip for mypy's automatic type-stub
|
|
# installation; '.[dev]' provides the rest (mypy resolves the
|
|
# package's own imports against the installed tree).
|
|
run: |
|
|
uv venv --seed --python 3.13
|
|
uv pip install '.[dev]'
|
|
|
|
- name: Check code and formatting
|
|
run: |
|
|
. .venv/bin/activate
|
|
scripts/check-python.sh great_ai tests
|
|
|
|
notebooks:
|
|
name: Notebooks on Python ${{ matrix.python-version }}
|
|
runs-on: docker
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ['3.12', '3.13']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
run: uv python install ${{ matrix.python-version }}
|
|
|
|
- name: Install notebook dependencies
|
|
run: |
|
|
uv venv --python ${{ matrix.python-version }}
|
|
uv pip install '.[notebooks]'
|
|
|
|
- name: Execute every notebook in a fresh workspace
|
|
env:
|
|
HF_HUB_OFFLINE: '1'
|
|
HF_DATASETS_OFFLINE: '1'
|
|
run: .venv/bin/python scripts/run-notebooks.py
|
|
|
|
test:
|
|
name: Test on Python ${{ matrix.python-version }}
|
|
runs-on: docker
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ['3.12', '3.13']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
run: uv python install ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv venv --python ${{ matrix.python-version }}
|
|
uv pip install '.[dev]'
|
|
|
|
- name: Run tests
|
|
run: |
|
|
. .venv/bin/activate
|
|
pytest --doctest-modules --asyncio-mode=strict
|