Merge pull request #90 from uofa-cmput404/RahulKorde19-patch-1 #236
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Django CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9, 3.10.8] | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: your_postgres_user | |
POSTGRES_PASSWORD: your_postgres_password | |
POSTGRES_DB: your_database_name | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 -r requirements.txt | |
pip3 install requests | |
- name: Set up PostgreSQL and Run Migrations | |
run: | | |
cd backend | |
python manage.py migrate | |
- name: Run Tests | |
run: | | |
cd backend | |
python manage.py test |