---
name: Django CI

on: [push, pull_request]

defaults:
  run:
    working-directory: src

jobs:
  build:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres
        env:
          POSTGRES_DB: smokeyfeet
          POSTGRES_USER: smokeyfeet
          POSTGRES_PASSWORD: smokeyfeet
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.8]

    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Run Tests
        env:
          SF_DB_URL: postgres://smokeyfeet:smokeyfeet@localhost:5432/smokeyfeet
          SF_DEFAULT_FROM_EMAIL: foo@example.com
          SF_SECRET_KEY: my-ci-secret-key
        run: |
          make test

---
name: Django CI

on: [push, pull_request]

defaults:
  run:
    working-directory: src

jobs:
  build:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres
        env:
          POSTGRES_DB: smokeyfeet
          POSTGRES_USER: smokeyfeet
          POSTGRES_PASSWORD: smokeyfeet
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.8]

    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Run Tests
        env:
          SF_DB_URL: postgres://smokeyfeet:smokeyfeet@localhost:5432/smokeyfeet
          SF_DEFAULT_FROM_EMAIL: foo@example.com
          SF_EMAIL_BACKEND: django.core.mail.backends.dummy.EmailBackend
          SF_SECRET_KEY: my-ci-secret-key
        run: |
          make test

Use "dummy" email backend for CI
Use "dummy" email backend for CI
