Skip to content

Commit ff4bfd4

Browse files
authored
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.
1 parent bb96d0f commit ff4bfd4

File tree

3 files changed

+65
-54
lines changed

3 files changed

+65
-54
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ source = numpydoc
44
include = */numpydoc/*
55
omit =
66
*/setup.py
7+
numpydoc/tests/*
8+
numpydoc/templates/*

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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"

.travis.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)