Skip to content

Merge pull request #4 from bertt6/CI/CD-TEST #15

Merge pull request #4 from bertt6/CI/CD-TEST

Merge pull request #4 from bertt6/CI/CD-TEST #15

Workflow file for this run

# test.yml
name: Run Django Tests
on:
push:
branches:
- '**'
jobs:
test-django-app:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: transcendenceDB
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- 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
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Django test
run: |
cd API
export PG_HOST=localhost
export PG_USER=postgres
export PG_PASSWORD=123
export PG_DB=transcendenceDB
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py test