Skip to content

improve testing

improve testing #47

Workflow file for this run

name: Pytest
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
env:
DEBUG: 0
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
IS_GITHUB_WORKFLOW: 1
OSU_CLIENT_ID: ${{ secrets.OSU_CLIENT_ID }}
OSU_CLIENT_SECRET: ${{ secrets.OSU_CLIENT_SECRET }}
OSU_CLIENT_REDIRECT_URI: ${{ secrets.OSU_CLIENT_REDIRECT_URI }}
PGDATABASE: otdb
PGUSER: otdb
PGPASSWORD: otdb
PGHOST: localhost
PGPORT: 5432
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start postgresql
shell: bash
run: |
sudo systemctl start postgresql.service
sudo -u postgres psql --command="CREATE USER otdb WITH SUPERUSER CREATEDB PASSWORD 'otdb'" --command="\du"
sudo -u postgres createdb --owner=otdb otdb
- name: Django migrations
working-directory: ./otdb
run: |
python manage.py migrate
- name: Test with pytest
working-directory: ./otdb
run: |
pytest