Try using uv for unit test workflow #180
This file contains 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
name: Check style + docs + types | |
on: | |
pull_request: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: . | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "pyproject.toml" | |
- name: Install package with check dependencies | |
run: uv sync --extra check | |
# check with ruff | |
- name: Run ruff | |
run: uv run ruff check | |
# check docs build | |
- name: Check that documentation builds with no errors or warnings | |
run: uv run sphinx-build docs docs/_build --fail-on-warning | |
# check types with mypy | |
- name: Check types in python src directory; install needed types | |
run: uv run mypy --install-types --non-interactive src | |
# use treon to make sure that example notebooks run | |
- name: Check jupyter notebooks with treon | |
run: uv run treon |