Skip to content

imports

imports #11

name: Test Cypress API PostgreSQL
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.12]
timeout-minutes: 10
steps:
- name: Start PostgreSQL
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres createdb db
printf "0000\n0000" | sudo -u postgres createuser -s -d -r -P runner
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv venv venv
. venv/bin/activate
uv pip install .[dev]
- name: Migrate
run: |
. venv/bin/activate
DATABASE_URL=postgresql://runner:0000@localhost:5432/db python manage.py migrate
- name: Run Django
run: |
. venv/bin/activate
make run DATABASE_URL=postgresql://runner:0000@localhost:5432/db ALLOWED_HOSTS=* &
sleep 4
- name: Setup Cypress
run: |
make setup-cypress
- name: Run Tests
run: |
make test-cypress-api