Skip to content

BUG: Fix the test workflow #18

BUG: Fix the test workflow

BUG: Fix the test workflow #18

Workflow file for this run

name: Run tests
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
- review_requested
branches:
- main
jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:15.5
env:
POSTGRES_DB: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
working-directory: backend
run: |
sudo apt install libcurl4-openssl-dev libssl-dev mysql-client
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
- name: Run tests
working-directory: backend
run: |
export DB_NAME=form
export DB_USER=root
export DB_PASSWORD=''
export DB_HOST=127.0.0.1
export DB_PORT=3306
pytest -c pytest.ini