Skip to content

Commit 15be3bf

Browse files
committed
Run tests using tox in CI
1 parent 9c472af commit 15be3bf

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [2.7]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- uses: actions/cache@v2
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
30+
restore-keys: |
31+
${{ runner.os }}-pip-
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install tox
36+
- name: Test with tox
37+
# Run tox using the version of Python in `PATH`
38+
run: |
39+
tox -e py

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.tox/
12
/build/
23
/dist/
34
/MANIFEST

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
package_data = {
4040
"sifter.t" : ["*.in", "*.out", "*.msg", "*.rules"],
4141
},
42+
install_requires=[
43+
"ply"
44+
],
4245
)
4346

tox.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# tox (https://tox.readthedocs.io/) is a tool for running tests
2+
# in multiple virtualenvs. This configuration file will run the
3+
# test suite on all supported python versions. To use it, "pip install tox"
4+
# and then run "tox" from this directory.
5+
6+
[tox]
7+
envlist = py27
8+
9+
[testenv]
10+
deps =
11+
12+
commands =
13+
python -m unittest discover -v

0 commit comments

Comments
 (0)