name: Python tests

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:13.4
        env:
          POSTGRES_DB: ccbv
          POSTGRES_USER: classy
          POSTGRES_PASSWORD: classy
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - name: Clone code
        uses: actions/checkout@v2

      - name: Install PostgreSQL client
        run: |
          sudo apt-get update
          sudo apt-get install --yes postgresql-client

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.6

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

      - name: Run Python tests
        run: |
          make test
        env:
          DATABASE_URL: postgres://classy:classy@localhost/ccbv

Add Python tests to GitHub Actions
Add Python tests to GitHub Actions
