Skip to content

Fix pyproject

Fix pyproject #243

Workflow file for this run

name: Main test
on:
push:
branches: [ stag, main ]
pull_request:
branches: [ stag ]
jobs:
build:
runs-on: ubuntu-latest
# NOTE: keep in sync with other workflows
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
sudo apt-get install -y redis-tools
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Run unit test and e2e test
env:
PGPASSWORD: postgres
SERVER_HOST: http://dev.cha.fan:8080
SERVER_NAME: dev.cha.fan
PROJECT_NAME: Chafan Dev
BACKEND_CORS_ORIGINS: '[]'
SECRET_KEY: chafandev
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chafan_dev
REDIS_URL: redis://localhost:6379
FIRST_SUPERUSER: admin@cha.fan
FIRST_SUPERUSER_PASSWORD: superuser
USERS_OPEN_REGISTRATION: True
RABBITMQ_URL: amqp://guest:guest@localhost:5672/%2f
EMAILS_FROM_EMAIL: contact@cha.fan
EMAILS_ENABLED: True
CREATE_SITE_FORCE_NEED_APPROVAL: False
ENV: dev
run: |
PYTHONPATH=$PWD make check
psql -h localhost -p 5432 -U postgres -c 'create database chafan_dev;'
PYTHONPATH=$PWD alembic upgrade head
PYTHONPATH=$PWD python scripts/initial_data.py
PYTHONPATH=$PWD scripts/run-unit-tests.sh