Skip to content

Django CI

Django CI #3

Workflow file for this run

name: Django CI
on:
workflow_dispatch
# push:
# branches: ["main"]
# pull_request:
# branches: ["main"]
env:
DEBUG: ${{ vars.DEV_DEBUG }}
SECRET_KEY: ${{ secrets.DEV_SECRET_KEY }}
ENGINE: ${{ vars.ENGINE }}
HOST: 127.0.0.1
PORT: ${{ vars.POSTGRES_PORT }}
NAME: ${{ vars.DEV_DB }}
USER: ${{ vars.POSTGRES_USER }}
PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
DB: db
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
services:
postgres:
image: postgres:14
env:
POSTGRES_DB: db
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
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