Skip to content

Commit 6402bf3

Browse files
committed
Add Github Actions workflow for running tests
Signed-off-by: Nabarun Pal <[email protected]>
1 parent 4e73e71 commit 6402bf3

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/test.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Workflow for running tests
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+
build:
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+
- name: Setup Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v1
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Cache pip
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.cache/pip
38+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
39+
restore-keys: |
40+
${{ runner.os }}-pip-
41+
${{ runner.os }}-
42+
- name: Install CI dependencies
43+
run: |
44+
pip install --upgrade pip
45+
pip install celery==3.1.20 Django==1.9 # required for running celery
46+
pip install nox
47+
pip install coveralls
48+
- name: Run celery worker for tests
49+
run: celery -A junction worker -l info --detach
50+
- name: Run tests
51+
run: nox -s test-${{ matrix.python-version }}
52+
finish:
53+
needs: build
54+
runs-on: ubuntu-16.04
55+
steps:
56+
- name: Send coverage report to coveralls and PR as a comment
57+
uses: coverallsapp/github-action@master
58+
with:
59+
github-token: ${{ secrets.github_token }}
60+
parallel-finished: true

0 commit comments

Comments
 (0)