Skip to content

add permission and refact #29

add permission and refact

add permission and refact #29

Workflow file for this run

name: Django Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: blogdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
env:
DJANGO_SETTINGS_MODULE: intraBlog.settings
SECRET_KEY: dummysecretkeyfortests
DB_NAME: blogdb
DB_USER: postgres
DB_PASSWORD: postgres
DB_HOST: localhost
DB_PORT: 5432
ENV: "tests"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run migrations
run: python manage.py migrate
- name: Run tests
run: python manage.py test
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
flags: unittests
name: codecov-report