Skip to content

Commit f479262

Browse files
committed
Move tests to actions
1 parent 82667b2 commit f479262

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.github/workflows/python-tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Run unit tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
tags:
8+
workflow_dispatch:
9+
schedule:
10+
# Run every Sunday at 03:53 UTC
11+
- cron: 53 2 * * 0
12+
13+
jobs:
14+
tests:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
python-version: 3.7
22+
toxenv: py36-test-sphinx17
23+
- os: windows-latest
24+
python-version: 3.7
25+
toxenv: py36-test-sphinx18
26+
- os: macos-latest
27+
python-version: 3.7
28+
toxenv: py37-test-sphinx20
29+
- os: ubuntu-latest
30+
python-version: 3.8
31+
toxenv: py37-test-sphinx24
32+
- os: windows-latest
33+
python-version: 3.8
34+
toxenv: py38-test-sphinx30
35+
- os: ubuntu-latest
36+
python-version: 3.9
37+
toxenv: py38-test-sphinx35
38+
- os: ubuntu-latest
39+
python-version: 3.9
40+
toxenv: py39-test-sphinx40
41+
- os: macos-latest
42+
python-version: 3.9
43+
toxenv: py38-test-sphinxdev
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
with:
48+
fetch-depth: 0
49+
- name: Set up Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v2
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
- name: Install Tox
54+
run: python -m pip install tox
55+
- name: Run Tox
56+
run: tox -v -e ${{ matrix.toxenv }}
57+
58+
# - name: Slack Notification
59+
# uses: 8398a7/action-slack@v3
60+
# with:
61+
# status: ${{ job.status }}
62+
# env:
63+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
64+
# if: always() # TODO: cron

tox.ini

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[tox]
2+
envlist =
3+
py{37,38,39}-test
4+
codestyle
5+
requires =
6+
setuptools >= 30.3.0
7+
pip >= 19.3.1
8+
isolated_build = true
9+
10+
[testenv]
11+
changedir = .tmp/{envname}
12+
description = run tests
13+
deps =
14+
sphinx17: sphinx==1.7.*
15+
sphinx18: sphinx==1.8.*
16+
sphinx20: sphinx==2.0.*
17+
sphinx24: sphinx==2.4.*
18+
sphinx30: sphinx==3.0.*
19+
sphinx35: sphinx==3.5.*
20+
sphinx40: sphinx==4.0.*
21+
sphinxdev: git+https://github.com/sphinx-doc/sphinx#egg=sphinx
22+
23+
commands =
24+
pip freeze
25+
pytest {toxinidir}/tests {posargs}
26+
27+
[testenv:codestyle]
28+
changedir =
29+
skip_install = true
30+
description = check code style, e.g. with flake8
31+
deps = flake8
32+
commands = flake8 sphinx_astropy --count

0 commit comments

Comments
 (0)