Skip to content

Commit

Permalink
First try for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-s committed Nov 7, 2020
1 parent 4df6637 commit 1e2ec85
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
django: ["2.2", "3.0", "3.1"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unittests
env:
TOX_ENV: py${{ matrix.python-version}}-django${{ matrix.django }}
run: |
tox -e $TOX_ENV
14 changes: 8 additions & 6 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
pep8
coverage
django-storages
flake8
mock
pep8
psycopg2
pylint
coverage
python-dotenv
python-gnupg
django-storages
pytz
testfixtures
mock
python-dotenv
psycopg2
tox-gh-actions
tox
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ deps =
-rrequirements-tests.txt
django2.2: Django>=2.2,<2.3
django3.0: Django>=3.0,<3.1
django3.1: Django>=3.1,<3.2
djangomaster: https://github.com/django/django/archive/master.zip
commands = {posargs:coverage run runtests.py}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38

[testenv:lint]
basepython = python
deps =
Expand Down

0 comments on commit 1e2ec85

Please sign in to comment.