2020-11-27 19:37:06 +00:00
|
|
|
name: Run Python Tests
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
max-parallel: 4
|
|
|
|
matrix:
|
|
|
|
db: [postgres]
|
|
|
|
python-version: [3.9]
|
|
|
|
include:
|
|
|
|
- db: postgres
|
|
|
|
db_port: 5432
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:10
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: hunter2
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -r requirements.txt
|
|
|
|
- name: Run Tests
|
|
|
|
env:
|
|
|
|
DB: ${{ matrix.db }}
|
|
|
|
DB_HOST: 127.0.0.1
|
|
|
|
DB_PORT: ${{ matrix.db_port }}
|
|
|
|
DB_PASSWORD: hunter2
|
|
|
|
SECRET_KEY: beepbeep
|
|
|
|
DEBUG: true
|
|
|
|
DOMAIN: your.domain.here
|
|
|
|
OL_URL: https://openlibrary.org
|
|
|
|
BOOKWYRM_DATABASE_BACKEND: postgres
|
|
|
|
MEDIA_ROOT: images/
|
|
|
|
POSTGRES_PASSWORD: hunter2
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_DB: github_actions
|
|
|
|
POSTGRES_HOST: 127.0.0.1
|
|
|
|
CELERY_BROKER: ""
|
2021-06-03 13:46:32 +00:00
|
|
|
REDIS_BROKER_PORT: 6379
|
|
|
|
FLOWER_PORT: 8888
|
2020-11-27 19:37:06 +00:00
|
|
|
EMAIL_HOST: "smtp.mailgun.org"
|
|
|
|
EMAIL_PORT: 587
|
|
|
|
EMAIL_HOST_USER: ""
|
|
|
|
EMAIL_HOST_PASSWORD: ""
|
|
|
|
EMAIL_USE_TLS: true
|
|
|
|
run: |
|
2021-03-24 19:58:39 +00:00
|
|
|
python manage.py test
|