name: code

on:
  pull_request:
  push:
    branches: master

jobs:
  test_matrix:
    name: ${{ matrix.postgres-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        python-version: [3.6, 3.7, 3.8]
        django-version: ["~=2.0.0", "~=2.1.0", "~=2.2.0", "~=3.0.0"]
        postgres-version: [10.12, 11.7, 12.2]
  
    steps:
    - uses: actions/checkout@v2

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

    - name: Install Python dependencies
      run: |
        pip install psycopg2
        # always use latest Django here b/c the point is to test PostgreSQL compatibility
        pip install Django
        python setup.py develop

    - name: Create database
      run: |
        # maps the container port to localhost
        docker run --name db -p 5432:5432 -d -e POSTGRES_PASSWORD=testing postgres:${{ matrix.postgres-version }}

        sleep 10 # wait for server to initialize
        PGPASSWORD="testing" psql -c 'create database dts_test_project;' -U postgres -h localhost

    - name: Run tests
      run: |
        export DATABASE_PASSWORD="testing"
        ./run_tests.sh


name: code

on:
  pull_request:
  push:
    branches: master

jobs:
  test_matrix:
    name: Python ${{ matrix.python-version }} / Django ${{ matrix.django-version}} / Postgres ${{ matrix.postgres-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        python-version: [3.6, 3.7, 3.8]
        django-version: ["~=2.0.0", "~=2.1.0", "~=2.2.0", "~=3.0.0"]
        postgres-version: [10.12, 11.7, 12.2]

    steps:
    - uses: actions/checkout@v2

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

    - name: Install Python dependencies
      run: |
        pip install psycopg2
        # always use latest Django here b/c the point is to test PostgreSQL compatibility
        pip install Django
        python setup.py develop

    - name: Create database
      run: |
        # maps the container port to localhost
        docker run --name db -p 5432:5432 -d -e POSTGRES_PASSWORD=testing postgres:${{ matrix.postgres-version }}

        sleep 10 # wait for server to initialize
        PGPASSWORD="testing" psql -c 'create database dts_test_project;' -U postgres -h localhost

    - name: Run tests
      run: |
        export DATABASE_PASSWORD="testing"
        ./run_tests.sh


Adjust CI checks names for better visibility
Adjust CI checks names for better visibility
