Skip to content

Commit

Permalink
Add Github Actions workflow for running tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nabarun Pal <[email protected]>
  • Loading branch information
palnabarun committed Jun 7, 2020
1 parent 65f40f6 commit e1d7ae3
Showing 1 changed file with 54 additions and 0 deletions.
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: Test
on:
push:
branches-ignore:
- django-2.2
pull_request:
branches-ignore:
- django-2.2

jobs:
test:
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
runs-on: ubuntu-16.04
env:
DJANGO_SETTINGS_MODULE: "settings.test_settings"
services:
postgres:
image: postgres:12.2
ports:
- 5432:5432
redis:
image: redis:6
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v2
# Python 3.5 needs to be set up here since Django 1.9 does not run beyond that
- name: Setup Python 3.5
uses: actions/setup-python@v1
with:
python-version: 3.5
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install CI dependencies
run: |
pip install --upgrade pip
pip install celery==3.1.20 Django==1.9 # required for running celery
pip install nox
pip install codecov
- name: Run celery worker for tests
run: celery -A junction worker -l info --detach
- name: Run tests
run: nox -s test-${{ matrix.python-version }}
- name: Report coverage
uses: codecov/codecov-action@v1

0 comments on commit e1d7ae3

Please sign in to comment.