Skip to content

Commit

Permalink
Create django.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
davnov015 authored Jun 10, 2024
1 parent 5e946fb commit 6106bae
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Django CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9, 3.10]
db: [postgres, mysql]
include:
- db: postgres
db_port: 5432
- db: mysql
db_port: 3306
services:
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_USER: permagate
POSTGRES_PASSWORD: SpYkxYy1dMmo7Bk
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

mysql:
image: mysql:8
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: SpYkxYy1dMmo7Bk
MYSQL_USER: permagate
MYSQL_PASSWORD: SpYkxYy1dMmo7Bk
options:
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
env:
DATABASE_URL: ${{ matrix.db }}://permagate:SpYkxYy1dMmo7Bk@127.0.0.1:${{ matrix.db_port }}/permagate
- name: Run Tests
run: |
python manage.py test

0 comments on commit 6106bae

Please sign in to comment.