Skip to content

Commit ef5cc9e

Browse files
authored
feat(CI): move to github actions
add initial github actions yml runs flake8 linter, unit tests, e2e tox tests in python version matrix
1 parent c444efe commit ef5cc9e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/main.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.6, 3.7, 3.8, pypy3, 3.9-dev, 3.10-dev]
12+
13+
steps:
14+
- name: Check out code into the Python module directory
15+
uses: actions/checkout@v2
16+
- name: Setup Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
if: "!endsWith(matrix.python-version, '-dev')"
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Setup test matrix
22+
uses: deadsnakes/action@v2.0.2
23+
if: endsWith(matrix.python-version, '-dev')
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt && pip install -r requirements-dev.txt
30+
pip install -e .; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Run unit tests
38+
run: |
39+
py.test test/
40+
- name: Install tox
41+
run: pip install tox
42+
- name: Run tox e2e tests
43+
run: tox -e integration
44+
45+
46+
47+

0 commit comments

Comments
 (0)