Refactor tests and update Docker configuration; add new test cases an… #1244
Workflow file for this run
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 ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: postgresql://postgres:[email protected]:5432/github_actions | |
DJANGO_SETTINGS_MODULE: website.settings.test | |
SECRET_KEY: 3573c6f0e4f7793 | |
services: | |
postgres: | |
image: postgres:16-alpine3.17 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
- name: Set up Python | |
run: uv python install | |
- name: Check Code Style | |
uses: pre-commit/[email protected] | |
- name: Set up Python | |
run: uv python install | |
- name: Install the project | |
run: uv sync --all-extras | |
- name: Run Django Check | |
env: | |
DJANGO_SETTINGS_MODULE: website.settings.prod | |
run: uv run python manage.py check --deploy | |
- name: Run Mypy Check | |
run: uv run mypy . | |
- name: Collect Static | |
run: uv run python manage.py collectstatic --noinput | |
- name: Run Tests | |
run: uv run coverage run -m pytest | |
- name: Show coverage report | |
run: uv run coverage report |