Skip to content

Commit

Permalink
added github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumandari committed Aug 20, 2021
1 parent ae9478f commit 352fb75
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[flake8]
exclude = */docs/*,*/.tox/*,*/.venv/*,*/.pycharm_helpers/*,*/migrations/*,docs/*,*/__init__.py,
*/manage.py,*/wsgi.py,
# we don't check this for now, until it's been fixed. otherwise it will throw lot of errors
qgis-app/plugins/*,
qgis-app/userexport/*,
qgis-app/lib/templatetags/*,
vagrant_assets/*,
qgis-app/users/*,
qgis-app/settings*,
qgis-app/qgis_context_processor.py,
qgis-app/search_sites.py,
qgis-app/urls.py,
qgis-app/custom_haystack_urls.py,
qgis-app/middleware.py,
qgis-app/homepage.py
max-line-length = 79

# E12x continuation line indentation
# E251 no spaces around keyword / parameter equals
# E303 too many blank lines (3)
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E251,E303,W503,W504,W60,F405
54 changes: 54 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: pr-test
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.7
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2

- name: Test installing development dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run Flake8 test
run: flake8 .
test:
runs-on: ubuntu-latest
needs:
- lint
steps:
- uses: actions/checkout@v2
- name: Run docker-compose build
working-directory: dockerize
run: docker-compose build
- name: Run the containers
working-directory: dockerize
run: docker-compose up -d db devweb
- name: Run Coverage test
working-directory: dockerize
run: |
cat << EOF | docker-compose exec -T devweb bash
pip install coverage
python manage.py makemigrations
python manage.py migrate
coverage run manage.py test
coverage xml
EOF
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 352fb75

Please sign in to comment.