Skip to content

Commit 2ef8bdc

Browse files
committed
Run tests in GitHub Actions
1 parent 21fb82d commit 2ef8bdc

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
"on": ["pull_request", "push"]
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
13+
- uses: actions/setup-python@v2
14+
15+
- uses: pre-commit/action@v2.0.0
16+
17+
typing:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0 # full history for setuptools_scm
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.8
28+
29+
- name: Python install
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install tox
33+
34+
- name: Run mypy
35+
run: tox -e typing
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
40+
strategy:
41+
matrix:
42+
python-version:
43+
- 3.7
44+
- 3.8
45+
- 3.9
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
with:
50+
fetch-depth: 0 # full history for setuptools_scm
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v2
54+
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Python install
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install tox
62+
63+
- name: Run tox
64+
run: tox -e py,packaging

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
[tox]
22
envlist =
3+
py
34
typing
45
lint
56
packaging
67
isolated_build = True
78
skip_missing_interpreters = True
89

10+
[testenv]
11+
description = Run unit tests
12+
extras =
13+
dev
14+
commands=
15+
pytest {posargs}
16+
917
[testenv:lint]
1018
description = Lint codebase by running pre-commit (Black, isort, Flake8).
1119
skip_install = true

0 commit comments

Comments
 (0)