Skip to content

Commit 2cbf58b

Browse files
authored
Merge pull request #70 from maxmind/greg/github-actions
Switch to GitHub Actions
2 parents e02d40d + ffdacff commit 2cbf58b

7 files changed

Lines changed: 94 additions & 63 deletions

File tree

.github/workflows/lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.8
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install --upgrade pylint black mypy voluptuous-stubs
26+
27+
- name: Install
28+
run: python setup.py install
29+
30+
- name: Run mypy
31+
run: mypy minfraud tests
32+
33+
- name: Run Pylint
34+
run: pylint minfraud
35+
36+
- name: Run Black
37+
run: black --check --diff .

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 -e git+https://github.com/maxmind/GeoIP2-python#egg=geoip2
37+
pip install tox tox-gh-actions
38+
39+
- name: Test with tox
40+
run: tox

.travis-black.sh

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

.travis-pylint.sh

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

.travis.yml

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

dev-bin/release.sh

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

7070
rm -fr dist
71-
python setup.py sdist bdist_wheel
71+
python setup.py build_html sdist bdist_wheel
7272
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)