name: CI

on: [pull_request]

jobs:
  build:

    runs-on: ubuntu-18.04

    strategy:
      matrix:
        python: [3.6, 3.7, 3.8, 3.9]
        django: [3.1, 3.2]
        database_url:
          - postgres://runner:password@localhost/project
          - mysql://root:root@127.0.0.1/project
          - 'sqlite:///:memory:'

    services:
      postgres:
        image: postgres:11
        ports:
          - 5432:5432
        env:
          POSTGRES_DB: project
          POSTGRES_USER: runner
          POSTGRES_PASSWORD: password

    env:
      DATABASE_URL: ${{ matrix.database_url }}

    steps:
    - name: Start MySQL
      run: sudo systemctl start mysql.service
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python }}
    - name: Install dependencies
      run: pip install -r test-requirements.txt
    - name: Install Django
      run: pip install -U django==${{ matrix.django }}
    - name: Run tests
      run: python manage.py test
    - name: Run black
      run: black --check django_dbq

name: CI

on: [pull_request]

jobs:
  build:

    runs-on: ubuntu-18.04

    strategy:
      matrix:
        python: [3.6, 3.7, 3.8, 3.9, "3.10"]
        django: [2.2, 3.2, 4.0]
        exclude:
          - python: 3.6
            django: 4.0
          - python: 3.7
            django: 4.0
          - python: "3.10"
            django: 2.2
        database_url:
          - postgres://runner:password@localhost/project
          - mysql://root:root@127.0.0.1/project
          - 'sqlite:///:memory:'

    services:
      postgres:
        image: postgres:11
        ports:
          - 5432:5432
        env:
          POSTGRES_DB: project
          POSTGRES_USER: runner
          POSTGRES_PASSWORD: password

    env:
      DATABASE_URL: ${{ matrix.database_url }}

    steps:
    - name: Start MySQL
      run: sudo systemctl start mysql.service
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python }}
    - name: Install dependencies
      run: pip install -r test-requirements.txt
    - name: Install Django
      run: pip install -U django==${{ matrix.django }}
    - name: Run tests
      run: python manage.py test
    - name: Run black
      run: black --check django_dbq

Add Django 4.0 and Python 3.10 to test matrix, remove unsupported versions
Add Django 4.0 and Python 3.10 to test matrix, remove unsupported versions
