|
| 1 | +name: numpydoc tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ${{ matrix.os }}-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [Ubuntu] |
| 15 | + python-version: [3.6, 3.7, 3.8, 3.9] |
| 16 | + sphinx-version: ["sphinx==1.6.5", "sphinx==2.1", "sphinx>3.0"] |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Python setup |
| 21 | + uses: actions/setup-python@v2 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Setup environment |
| 26 | + run: | |
| 27 | + python -m venv venv |
| 28 | + source venv/bin/activate |
| 29 | +
|
| 30 | + - name: Install |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip wheel setuptools |
| 33 | + python -m pip install -r test_requirements.txt -r doc/requirements.txt |
| 34 | + python -m pip install codecov |
| 35 | + python -m pip install ${{ matrix.sphinx-version }} |
| 36 | + python -m pip install . |
| 37 | + pip list |
| 38 | +
|
| 39 | + - name: Run test suite |
| 40 | + run: | |
| 41 | + pytest -v --pyargs . |
| 42 | +
|
| 43 | + - name: Test coverage |
| 44 | + run: | |
| 45 | + codecov |
| 46 | +
|
| 47 | + - name: Make sure CLI works |
| 48 | + run: | |
| 49 | + python -m numpydoc numpydoc.tests.test_main._capture_stdout |
| 50 | + echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash |
| 51 | + python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout |
| 52 | + echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash |
| 53 | +
|
| 54 | + - name: Setup for doc build |
| 55 | + run: | |
| 56 | + # Get scipy-sphinx-theme |
| 57 | + git submodule update --init |
| 58 | + sudo apt install texlive texlive-latex-extra latexmk dvipng |
| 59 | +
|
| 60 | + - name: Build documentation |
| 61 | + run: | |
| 62 | + make -C doc html SPHINXOPTS="-nT" |
| 63 | + make -C doc latexpdf SPHINXOPTS="-nT" |
0 commit comments