1212 build-and-test :
1313 name : " Python ${{ matrix.python-version }} on ${{ matrix.os }} jax=${{ matrix.jax-version }}"
1414 runs-on : " ${{ matrix.os }}"
15-
1615 strategy :
1716 matrix :
1817 python-version : ["3.9", "3.10", "3.11"]
2221 - python-version : " 3.9"
2322 os : " ubuntu-latest"
2423 jax-version : " 0.4.27" # Keep version in sync with pyproject.toml and copy.bara.sky!
25-
2624 steps :
2725 - uses : " actions/checkout@v2"
2826 - uses : " actions/setup-python@v4"
@@ -33,13 +31,72 @@ jobs:
3331 - name : Run CI tests
3432 run : JAX_VERSION="${{ matrix.jax-version }}" bash test.sh
3533 shell : bash
34+ doctests :
35+ name : " Doctests on ${{ matrix.os }} with Python ${{ matrix.python-version }}"
36+ runs-on : " ${{ matrix.os }}"
37+ strategy :
38+ matrix :
39+ python-version : ["3.11"] # only build docs with a somewhat latest python
40+ os : [ubuntu-latest]
41+ steps :
42+ - uses : " actions/checkout@v2"
43+ - uses : " actions/setup-python@v4"
44+ with :
45+ python-version : " ${{ matrix.python-version }}"
46+ cache : " pip"
47+ cache-dependency-path : ' pyproject.toml'
48+ - name : Build docs and run doctests
49+ run : |
50+ python3 -m pip install --quiet --editable ".[docs]"
51+ cd docs
52+ make html
53+ make doctest # run doctests
54+ shell : bash
55+ linting :
56+ name : " Lint check with flake8 and pylint"
57+ runs-on : " ubuntu-latest"
58+ steps :
59+ - uses : " actions/checkout@v2"
60+ - uses : " actions/setup-python@v4"
61+ with :
62+ python-version : " 3.11"
63+ cache : " pip"
64+ cache-dependency-path : " pyproject.toml"
65+ - name : Install linting dependencies
66+ run : |
67+ pip install -U pip setuptools wheel
68+ pip install -U flake8 pytest-xdist pylint pylint-exit
69+ - name : Lint with flake8
70+ run : |
71+ python3 -m flake8 --select=E9,F63,F7,F82,E225,E251 --show-source --statistics
72+ - name : Lint module files with pylint
73+ run : |
74+ PYLINT_ARGS="-efail -wfail -cfail -rfail"
75+ python3 -m pylint --rcfile=.pylintrc $(find optax -name '*.py' | grep -v 'test.py' | xargs) -d E1102 || pylint-exit $PYLINT_ARGS $?
76+ - name : Lint test files with pylint
77+ run : |
78+ PYLINT_ARGS="-efail -wfail -cfail -rfail"
79+ python3 -m pylint --rcfile=.pylintrc $(find optax -name '*_test.py' | xargs) -d W0212,E1102 || pylint-exit $PYLINT_ARGS $?
80+ ruff-lint :
81+ name : " Lint check with ruff"
82+ runs-on : " ubuntu-latest"
83+ steps :
84+ - uses : " actions/checkout@v2"
85+ - uses : " actions/setup-python@v4"
86+ with :
87+ python-version : " 3.11"
88+ cache : " pip"
89+ cache-dependency-path : " pyproject.toml"
90+ - name : Install ruff and lint check
91+ run : |
92+ pip install -U ruff
93+ ruff check .
3694 markdown-link-check :
3795 name : " Check links in markdown files"
3896 runs-on : " ubuntu-latest"
3997 steps :
4098 - name : Checkout repository
4199 uses : actions/checkout@v4
42-
43100 - name : Check links
44101 uses : gaurav-nelson/github-action-markdown-link-check@v1
45102 with :
0 commit comments