Skip to content

Updated GitHub Actions #24

Updated GitHub Actions

Updated GitHub Actions #24

Workflow file for this run

name: Django CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
SECRET_KEY: yoursecretkey
DEBUG: True
DATABASE_NAME: postgres
DATABASE_USER: postgres
DATABASE_PASS: postgres
DATABASE_HOST: localhost
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, '3.10']
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: food
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run migrations
run: |
python manage.py makemigrations
python manage.py migrate
- name: Lint with flake8
run: |
flake8
- name: Run Tests
run: |
python manage.py test