Skip to content

Commit ffc3587

Browse files
committed
GH-17: Set up a CI for running the tests with tox
1 parent e2741ae commit ffc3587

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master, tests ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
12+
strategy:
13+
matrix:
14+
include:
15+
- python-version: "3.6"
16+
env: python3.6
17+
os: ubuntu-20.04 # 3.6 is not available on ubuntu-20.04
18+
- python-version: "3.7"
19+
env: python3.7
20+
- python-version: "3.8"
21+
env: python3.8
22+
- python-version: "3.9"
23+
env: python3.9
24+
- python-version: "3.10"
25+
env: python3.10
26+
- python-version: "3.11"
27+
env: python3.11
28+
- python-version: "3.12"
29+
env: python3.12
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Install dependencies
38+
run: |
39+
pip install --upgrade pip
40+
python -m pip install -e .
41+
pip install tox tox-gh-actions
42+
- name: Run tests on different Python versions
43+
run: tox -e ${{ matrix.env }}

tox.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tox]
2+
minversion = 3.6.0
3+
envlist =
4+
python3.6
5+
python3.7
6+
python3.8
7+
python3.9
8+
python3.10
9+
python3.11
10+
python3.12
11+
isolated_build = true
12+
13+
[testenv]
14+
setenv =
15+
PYTHONPATH = {toxinidir}
16+
deps =
17+
-r{toxinidir}/tests/requirements.txt
18+
commands =
19+
pip install -e .
20+
pytest --basetemp={envtmpdir}

0 commit comments

Comments
 (0)