Skip to content

Commit

Permalink
Try workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gannetson committed Jun 22, 2022
1 parent 72ec92c commit 252f279
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 64 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Django CI

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

jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgis/postgis:11-2.5
env:
POSTGRES_USER: bb
POSTGRES_PASSWORD: bb
POSTGRES_DB: test_bluebottle_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.23
env:
discovery.type: single-node
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 9200:9200
redis:
image: redis
ports:
- 6379:6379
celery:
image: celery
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v3
- name: Install packages
run: sudo apt-get install -y libxmlsec1 libxmlsec1-dev libgdal-dev openjdk-8-jdk-headless
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Test data
run: |
psql -h localhost -U bb test_bluebottle_test < testdata.sql
env:
PGPASSWORD: bb
- name: Setup Locale
run: |
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.py') }}-${{ hashFiles('setup.py') }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[test] --trusted-host github.com
- name: Run Tests
run: |
python -m coverage run --parallel-mode --source=bluebottle manage.py test --parallel=8 --keepdb --settings bluebottle.settings.github
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ install:
before_script:
- flake8 .
script:
- python -m coverage run --parallel-mode --source=bluebottle manage.py test --keepdb
- python -m coverage run --parallel-mode --source=bluebottle manage.py test --parallel=8 --keepdb
notifications:
slack:
secure: TOveMBh9HePYKWuGTrWF+hTXzxGZvbVsa3KU0sB1yv6qkcixb5/ggvmkTeRddYEd/zyWyMenicFsrXVBgsP0SmbNgke6kq5+EN0U5oJWse998lvCVCpwmJQMdwDHvYsOtbFEOppQrbRK4vmH8qibx3x2YVg+u+61ePHvWYF9z6U=
Expand Down
18 changes: 18 additions & 0 deletions bluebottle/settings/github.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# flake8: noqa

from .testing import *

DATABASES = {
'default': {
"ENGINE": "bluebottle.clients.postgresql_backend",
'HOST': 'localhost',
'PORT': '5432',
'NAME': 'bluebottle_test',
'USER': 'bb',
'PASSWORD': 'bb'
}
}

PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']

DEBUG = False
2 changes: 1 addition & 1 deletion bluebottle/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}


TEST_RUNNER = 'bluebottle.test.test_runner.MultiTenantRunner'
TEST_RUNNER = 'django_slowtests.testrunner.DiscoverSlowestTestsRunner'
NUM_SLOW_TESTS = 50

DEBUG = False
Expand Down
62 changes: 0 additions & 62 deletions bluebottle/test/test_runner.py

This file was deleted.

0 comments on commit 252f279

Please sign in to comment.