Skip to content

Commit

Permalink
test backend ci
Browse files Browse the repository at this point in the history
  • Loading branch information
EhsanGheychisaz committed Apr 14, 2024
1 parent b242218 commit 55675d8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/django_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Django Tests

on:
push:
branches:
- test-ci
jobs:
test:
runs-on: ubuntu-latest

services:
sqlite:
image: python:3
env:
SQLITE_DB: test_db.sqlite3
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Prepare SQLite database
run: |
python manage.py makemigrations
python manage.py migrate

- name: Run tests
run: |
python manage.py test apps.report
Empty file added apps/__init__.py
Empty file.
5 changes: 4 additions & 1 deletion apps/report/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.test import TestCase

# Create your tests here.
class HelloWorldTest(TestCase):
def test_hello_world(self):
print("Hello, world!")

0 comments on commit 55675d8

Please sign in to comment.