Skip to content

Commit 105c8aa

Browse files
authored
Merge pull request #100 from maxmind/greg/github-actions
Switch to GitHub Actions
2 parents ef04c93 + 77f5142 commit 105c8aa

File tree

8 files changed

+96
-78
lines changed

8 files changed

+96
-78
lines changed

.github/workflows/lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '3 19 * * SUN'
8+
9+
jobs:
10+
build:
11+
12+
name: Python linting
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.8
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install --upgrade pylint black mypy voluptuous-stubs
28+
29+
- name: Install
30+
run: python setup.py install
31+
32+
- name: Run mypy
33+
run: mypy geoip2 tests
34+
35+
- name: Run Pylint
36+
run: pylint geoip2
37+
38+
- name: Run Black
39+
run: black --check --diff .

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '3 15 * * SUN'
8+
9+
jobs:
10+
build:
11+
12+
strategy:
13+
matrix:
14+
# We don't test on Windows currently as it appears mocket may not
15+
# work there.
16+
platform: [ubuntu-latest, macos-latest]
17+
python-version: [3.6, 3.7, 3.8, 3.9]
18+
19+
name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
20+
runs-on: ${{ matrix.platform }}
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install tox tox-gh-actions
37+
38+
- name: Test with tox
39+
run: tox

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ pylint.txt
1717
.pyre
1818
.pytype
1919
*.swp
20+
.tox
2021
violations.pyflakes.txt

.travis-black.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.travis-pylint.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

dev-bin/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ hub release create -m "$message" "$tag"
6767
git push --tags
6868

6969
rm -fr dist
70-
python setup.py sdist bdist_wheel
70+
python setup.py build_html sdist bdist_wheel
7171
twine upload dist/*

setup.cfg

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
[aliases]
22
build_html = build_sphinx -b html --build-dir docs
3-
sdist = build_html sdist
43

54
[flake8]
65
# black uses 88 : ¯\_(ツ)_/¯
76
max-line-length = 88
87

98
[wheel]
109
universal = 1
10+
11+
[tox:tox]
12+
envlist = py36, py37, py38, mypy
13+
14+
[gh-actions]
15+
python =
16+
3.6: py36
17+
3.7: py37
18+
3.8: py38
19+
3.9: py39, mypy
20+
21+
[testenv]
22+
deps =
23+
pytest
24+
mocket
25+
commands = pytest tests

0 commit comments

Comments
 (0)