Skip to content

Commit

Permalink
CI: Switch from travis to Github actions for tests (#307)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rossbar authored Dec 15, 2020
1 parent bb96d0f commit ff4bfd4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ source = numpydoc
include = */numpydoc/*
omit =
*/setup.py
numpydoc/tests/*
numpydoc/templates/*
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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"
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

0 comments on commit ff4bfd4

Please sign in to comment.