Skip to content

Commit 25280c0

Browse files
committed
Add Github actions for linter & tests
1 parent bc95b62 commit 25280c0

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

.github/workflows/tests.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Git checkout
9+
uses: actions/checkout@v2
10+
- name: Setup Python ${{ matrix.python-version }}
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.8
14+
architecture: x64
15+
- name: Install requirements
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install ".[dev]"
19+
- name: Display packages version
20+
run: |
21+
python -c "import sys; print(sys.version)"
22+
pip freeze
23+
whatportis --version
24+
- name: Run Black
25+
run: black --diff --check {whatportis,tests}
26+
27+
tests:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
python-version: [3.6, 3.7, 3.8, 3.9]
32+
steps:
33+
- name: Git checkout
34+
uses: actions/checkout@v2
35+
- name: Setup Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
architecture: x64
40+
- name: Install requirements
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install ".[dev]"
44+
- name: Display packages version
45+
run: |
46+
python -c "import sys; print(sys.version)"
47+
pip freeze
48+
whatportis --version
49+
- name: Execute tests
50+
run: pytest tests/ -v

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
extras_require={
2828
"dev": [
2929
"pytest",
30-
"tox"
30+
"tox",
31+
"black"
3132
],
3233
"server": [
3334
"flask==1.1.2"

0 commit comments

Comments
 (0)