Skip to content

MailGuardian V3

MailGuardian V3 #28

Workflow file for this run

name: Django CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
db: [postgres12, postgres13, postgres14, postgres15]
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- db: postgres12
db_port: 54312
- db: postgres13
db_port: 54313
- db: postgres14
db_port: 54314
- db: postgres15
db_port: 54315
services:
postgres12:
image: postgres:12
env:
POSTGRES_USER: mailguardian
POSTGRES_PASSWORD: mailguardian
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54312:5432
postgres13:
image: postgres:13
env:
POSTGRES_USER: mailguardian
POSTGRES_PASSWORD: mailguardian
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54313:5432
postgres14:
image: postgres:14
env:
POSTGRES_USER: mailguardian
POSTGRES_PASSWORD: mailguardian
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54314:5432
postgres15:
image: postgres:15
env:
POSTGRES_USER: mailguardian
POSTGRES_PASSWORD: mailguardian
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54315:5432
steps:
- 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: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Migrations
env:
MAILGUARDIAN_DB_NAME: mailguardian
MAILGUARDIAN_DB_USER: mailguardian
MAILGUARDIAN_DB_HOST: 127.0.0.1
MAILGUARDIAN_DB_PORT: ${{ matrix.db_port }}
MAILGUARDIAN_DB_PASSWD: mailguardian
run: |
python src/manage.py migrate
- name: Run Tests
env:
MAILGUARDIAN_DB_NAME: mailguardian
MAILGUARDIAN_DB_USER: mailguardian
MAILGUARDIAN_DB_HOST: 127.0.0.1
MAILGUARDIAN_DB_PORT: ${{ matrix.db_port }}
MAILGUARDIAN_DB_PASSWD: mailguardian
run: |
python src/manage.py test