-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (44 loc) · 1.6 KB
/
Copy pathcheck.yml
File metadata and controls
44 lines (44 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Check style + docs + types
on:
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install package with check dependencies
run: uv sync --group check
- name: Run Ruff linter
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
with:
args: "check --output-format=github"
- name: Run Ruff formatter
# NOTE: ruff format does not currently support github output format
run: ruff format --check --diff src tests
# Check formatting even if the previous step failed
if: always()
# 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 --follow-untyped-imports
# use treon to make sure that example notebooks run
- name: Check jupyter notebooks with treon
run: uv run treon