Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.
36 changes: 36 additions & 0 deletions .github/workflows/django_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Django Tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Prepare Test Env

run: |
cp ihart_backend/ihart_backend/example.env ihart_backend/ihart_backend/.env
sed -i 's/db_username/root/g' ihart_backend/ihart_backend/.env
sed -i 's/db_password/root/g' ihart_backend/ihart_backend/.env
sudo systemctl start mysql.service
sudo mysql -uroot -proot -e 'CREATE DATABASE IHART;'
sleep 20

- name: Run Tests
run: |
python ihart_backend/manage.py test