name: Run tests

on: [push]

jobs:
  build:
    runs-on: ubuntu-20.04

    services:
      postgres:
        image: postgres:9.6
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: "kaka"
          POSTGRES_DB: test_karspexet
        ports:
          - 5432:5432/tcp
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - uses: actions/checkout@v2

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

      - name: Install Poetry
        run: |
          pip install --upgrade pip setuptools wheel poetry
          poetry install

      - name: Copy sample config
        run: cp env.json{.sample,} || /bin/true

      - name: Lint with flake8
        run: |
          # stop the build if there are Python syntax errors or undefined names
          poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
          # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
          poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

      - name: Test with pytest
        env:
          DATABASE_URL: "postgresql://postgres:kaka@localhost/test_karspexet"
        run: poetry run pytest

name: Run tests

on: [push]

jobs:
  build:
    runs-on: ubuntu-20.04

    services:
      postgres:
        image: postgres:9.6
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: "kaka"
          POSTGRES_DB: test_karspexet
        ports:
          - 5432:5432/tcp
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - uses: actions/checkout@v2

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

      - name: Install Poetry
        run: |
          pip install --upgrade pip setuptools wheel poetry
          poetry install

      - name: Copy sample config
        run: cp env.json{.sample,} || /bin/true

      - name: Lint with flake8
        run: |
          # stop the build if there are Python syntax errors or undefined names
          poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
          # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
          poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

      - name: Test with pytest
        env:
          DATABASE_URL: "postgresql://postgres:kaka@localhost/test_karspexet"
        run: poetry run pytest

Fix Yaml error in Python version
Fix Yaml error in Python version
