Skip to content

Commit 7a436fc

Browse files
committed
First try for github action
1 parent 4df6637 commit 7a436fc

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.5, 3.6, 3.7, 3.8]
19+
django: [2.2, 3.0, 3.1]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements-tests.txt
31+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32+
- name: Run unittests
33+
env:
34+
TOX_ENV: py${{ matrix.python-version}}-django${{ matrix.django }}
35+
run: |
36+
tox -e $TOX_ENV

requirements-tests.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
pep8
1+
coverage
2+
django-storages
23
flake8
4+
mock
5+
pep8
6+
psycopg2
37
pylint
4-
coverage
8+
python-dotenv
59
python-gnupg
6-
django-storages
710
pytz
811
testfixtures
9-
mock
10-
python-dotenv
11-
psycopg2
12+
tox-gh-actions
13+
tox

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ deps =
1616
-rrequirements-tests.txt
1717
django2.2: Django>=2.2,<2.3
1818
django3.0: Django>=3.0,<3.1
19+
django3.1: Django>=3.1,<3.2
1920
djangomaster: https://github.com/django/django/archive/master.zip
2021
commands = {posargs:coverage run runtests.py}
2122

23+
[gh-actions]
24+
python =
25+
3.6: py36
26+
3.7: py37
27+
3.8: py38
28+
2229
[testenv:lint]
2330
basepython = python
2431
deps =

0 commit comments

Comments
 (0)