Skip to content

Add unit tests

Add unit tests #3

Workflow file for this run

name: Django Tests
on:
push:
branches: [main]
pull_request:
branches: [main, develop]
workflow_dispatch:
inputs:
config:
description: "Which compose config file to deploy"
required: true
default: "docker-compose.dev.yml"
type: choice
options:
- "docker-compose.dev.yml"
- "docker-compose.stag.yml"
- "docker-compose.yml"
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd backend
pip install -r requirements.txt
- name: Run migrations
run: |
cd backend
python manage.py migrate
- name: Run tests
run: |
cd backend
python manage.py test tests
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
file: ./backend/coverage.xml
fail_ci_if_error: true