Skip to content

Commit

Permalink
Migrate to GitHub action (#126)
Browse files Browse the repository at this point in the history
* add github action workflow

* fix flake8 error

* remove travis.yml

* typo

* update tox
  • Loading branch information
Demetriex authored Apr 22, 2021
1 parent e3d5e50 commit 6c4792c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 42 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install --upgrade pip wheel tox
- run: tox -e flake8
tests:
name: tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- run: python -m pip install --upgrade pip wheel
- run: pip install tox tox-gh-actions
- run: tox
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install --upgrade pip wheel
- run: pip install tox codecov
- run: tox -e covarage
- run: codecov
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion flask_bootstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
from flask import current_app, Markup, Blueprint, url_for

try: # pragma: no cover
try: # pragma: no cover
from wtforms.fields import HiddenField
except ImportError:
def is_hidden_field_filter(field):
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ exclude = static,.git,*migrations*,build,.tox,docs
max-line-length = 119
max-complexity = 7

[options]
setup_requires = pytest-runner
tests_require = pytest

[aliases]
test = pytest

[tool:pytest]
testpaths = tests
testpaths = tests
2 changes: 1 addition & 1 deletion tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_cdn_resources(self, bootstrap, client):
assert '/bootstrap/static/js/bootstrap.min.js' not in js_rv
assert 'https://cdn.jsdelivr.net/npm/bootstrap' in css_rv
assert 'https://cdn.jsdelivr.net/npm/bootstrap' in js_rv

@pytest.mark.parametrize(
['with_jquery', 'with_popper'],
[
Expand Down
35 changes: 20 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
[tox]
envlist = py27, py35, py36, py37, py38
envlist = py27, py35, py36, py37, py38, py39
skip_missing_interpreters = true
skipsdist = true

[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39

[testenv]
deps =
pytest
flask-wtf
flask-sqlalchemy
commands =
python setup.py test

[testenv:coverage]
basepython = python2.7
deps =
pytest
coverage
flask-wtf
flask-sqlalchemy
commands =
coverage run --source=flask_bootstrap setup.py test
coverage report
coverage html

[testenv:flake8]
basepython = python2.7
deps =
flake8
commands =
flake8 flask_bootstrap tests

[testenv:covarage]
deps =
flake8
pytest
pytest-cov
flask-wtf
flask-sqlalchemy
commands =
pytest --cov=flask_bootstrap --cov-branch

0 comments on commit 6c4792c

Please sign in to comment.