Skip to content

Commit e1d7ae3

Browse files
committed
Add Github Actions workflow for running tests
Signed-off-by: Nabarun Pal <[email protected]>
1 parent 65f40f6 commit e1d7ae3

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
on:
3+
push:
4+
branches-ignore:
5+
- django-2.2
6+
pull_request:
7+
branches-ignore:
8+
- django-2.2
9+
10+
jobs:
11+
test:
12+
strategy:
13+
matrix:
14+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
15+
runs-on: ubuntu-16.04
16+
env:
17+
DJANGO_SETTINGS_MODULE: "settings.test_settings"
18+
services:
19+
postgres:
20+
image: postgres:12.2
21+
ports:
22+
- 5432:5432
23+
redis:
24+
image: redis:6
25+
ports:
26+
- 6379:6379
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
# Python 3.5 needs to be set up here since Django 1.9 does not run beyond that
31+
- name: Setup Python 3.5
32+
uses: actions/setup-python@v1
33+
with:
34+
python-version: 3.5
35+
- name: Cache pip
36+
uses: actions/cache@v2
37+
with:
38+
path: ~/.cache/pip
39+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
40+
restore-keys: |
41+
${{ runner.os }}-pip-
42+
${{ runner.os }}-
43+
- name: Install CI dependencies
44+
run: |
45+
pip install --upgrade pip
46+
pip install celery==3.1.20 Django==1.9 # required for running celery
47+
pip install nox
48+
pip install codecov
49+
- name: Run celery worker for tests
50+
run: celery -A junction worker -l info --detach
51+
- name: Run tests
52+
run: nox -s test-${{ matrix.python-version }}
53+
- name: Report coverage
54+
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)