Skip to content

Commit 2101b31

Browse files
committed
Add github workflow to run tests and static checks
1 parent c00b26e commit 2101b31

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/python-tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run python tests
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]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install pycodestyle isort pylint yapf
23+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24+
- name: Check import sorting
25+
run: |
26+
isort --diff --check --recursive sshpubkeys tests
27+
- name: Check pycodestyle
28+
run: |
29+
pycodestyle --ignore E501,E402 --exclude=.git,dev3 sshpubkeys tests
30+
- name: Run pylint
31+
run: |
32+
pylint sshpubkeys tests
33+
- name: Run tests
34+
run: |
35+
python3 setup.py test
36+
- name: Check formatting
37+
run: |
38+
isort --recursive sshpubkeys tests; yapf --recursive .
39+
git diff --exit-code # This fails if isort&yapf combo made any changes

0 commit comments

Comments
 (0)