Skip to content

Commit 55e7d6d

Browse files
authored
Merge pull request #6 from redtoad/github-actions
Run tox via GitHub actions
2 parents 491bb97 + 72283e6 commit 55e7d6d

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests with tox
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
# Not all Python versions are avalaible for linux AND x64
13+
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
14+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox tox-gh-actions
26+
- name: Test with tox
27+
run: tox -vv

tox.ini

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
[tox]
2-
envlist = py26,py27,py33,py34,py35,py36,py37
2+
envlist = py27,py33,py34,py35,py36,py37,py38,py39,py310
33
recreate = True
44

55
[tox:hudson]
66
downloadcache = {toxworkdir}/_download
77

8+
[gh-actions]
9+
python =
10+
2.7: py27
11+
3.3: py33
12+
3.4: py34
13+
3.5: py35
14+
3.6: py36
15+
3.7: py37
16+
3.8: py38
17+
3.9: py39
18+
3.10: py310
19+
820
[testenv]
21+
description = run test suite under {basepython}
922
deps =
10-
pytest>=2.0.0
23+
pytest >=4, <7; python_version<'3.10'
24+
pytest >=6.2.5, <7; python_version>='3.10'
25+
# pytest-cov >=2, <3
26+
pytest-cov
1127
six
1228
requests
1329
commands =
1430
py.test -v \
1531
--junitxml=junit-{envname}.xml \
16-
[] # substitute with tox' positional arguments
17-
32+
{posargs}

0 commit comments

Comments
 (0)