diff options
author | Ross Barnowski <rossbar@berkeley.edu> | 2020-12-15 05:17:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 08:17:56 -0500 |
commit | ff4bfd4e469d63069572d39318ed628eca892097 (patch) | |
tree | b0a1a0cea54b4dc60ed40c6dce3e3fc5c0309f30 | |
parent | bb96d0fca570cec533251ef4c0f309020a5dca04 (diff) | |
download | numpydoc-ff4bfd4e469d63069572d39318ed628eca892097.tar.gz |
CI: Switch from travis to Github actions for tests (#307)
* Setup test workflow with github actions
* Add sphinx version to matrix.
* Add doc building to test workflow.
* Add codecov step to test workflow.
* Remove travis config.
* WIP: try without action.
-rw-r--r-- | .coveragerc | 2 | ||||
-rw-r--r-- | .github/workflows/test.yml | 63 | ||||
-rw-r--r-- | .travis.yml | 54 |
3 files changed, 65 insertions, 54 deletions
diff --git a/.coveragerc b/.coveragerc index 92a2a25..efab5a6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,3 +4,5 @@ source = numpydoc include = */numpydoc/* omit = */setup.py + numpydoc/tests/* + numpydoc/templates/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c6eafc5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,63 @@ +name: numpydoc tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ${{ matrix.os }}-latest + strategy: + matrix: + os: [Ubuntu] + python-version: [3.6, 3.7, 3.8, 3.9] + sphinx-version: ["sphinx==1.6.5", "sphinx==2.1", "sphinx>3.0"] + steps: + - uses: actions/checkout@v2 + + - name: Python setup + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Setup environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install + run: | + python -m pip install --upgrade pip wheel setuptools + python -m pip install -r test_requirements.txt -r doc/requirements.txt + python -m pip install codecov + python -m pip install ${{ matrix.sphinx-version }} + python -m pip install . + pip list + + - name: Run test suite + run: | + pytest -v --pyargs . + + - name: Test coverage + run: | + codecov + + - name: Make sure CLI works + run: | + python -m numpydoc numpydoc.tests.test_main._capture_stdout + echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash + python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout + echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash + + - name: Setup for doc build + run: | + # Get scipy-sphinx-theme + git submodule update --init + sudo apt install texlive texlive-latex-extra latexmk dvipng + + - name: Build documentation + run: | + make -C doc html SPHINXOPTS="-nT" + make -C doc latexpdf SPHINXOPTS="-nT" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f55255b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -# After changing this file, check it on: -# http://lint.travis-ci.org/ -language: python -group: travis_latest -os: linux -dist: bionic - -addons: - apt: - packages: - - texlive - - texlive-latex-extra - - latexmk - - dvipng - -cache: - directories: - - $HOME/.cache/pip - -jobs: - include: - - python: 3.7 - - python: 3.6 - env: SPHINX_SPEC="==2.1.0" SPHINXOPTS="" - - python: 3.6 - env: SPHINX_SPEC="==1.6.5" SPHINXOPTS="" - -before_install: - - pip install --upgrade pip setuptools # Ensure there is `wheel` support - - pip install pytest pytest-cov pydocstyle numpy matplotlib sphinx${SPHINX_SPEC} codecov check-manifest - -script: - - check-manifest - - | - python setup.py sdist - cd dist - pip install numpydoc* -v - - pytest -v --pyargs numpydoc - # Making sure the command line options work - - python -m numpydoc numpydoc.tests.test_main._capture_stdout - - echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash - - python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout - - echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash - - pydocstyle --convention numpy ../doc/example.py - # Build documentation - - | - cd ../doc - make SPHINXOPTS=$SPHINXOPTS html - make SPHINXOPTS=$SPHINXOPTS latexpdf - -after_script: - - | - cd ../dist - codecov |