name: Code quality checks

on:
  push:
    branches:
      - main
      - dev
      - prod
  pull_request:

jobs:
  code_quality:
    name: Check code quality

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        python-version: [3.9]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

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

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          # curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
          pip install poetry
          # source $HOME/.poetry/env
          poetry config virtualenvs.create false
          poetry install --no-root --no-interaction

      - name: Check code formatting
        run: make formatcheck

      - name: Check for linter errors
        run: make lint

      - name: Check for security issues
        run: make bandit

      - name: Run tests
        run: make test

      - name: Check code coverage
        run: make covcheck

      # TODO
      # - name: Check type annotations
      #   run: make typecheck

      # TODO
      # - name: Check docstring style
      #   run: make doccheck

name: Code quality checks

on:
  push:
    branches:
      - main
      - dev
      - prod
  pull_request:

jobs:
  code_quality:
    name: Check code quality

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        python-version: [3.9]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

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

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
          source $HOME/.poetry/env
          poetry config virtualenvs.create false
          poetry install --no-root --no-interaction

      - name: Check code formatting
        run: make formatcheck

      - name: Check for linter errors
        run: make lint

      - name: Check for security issues
        run: make bandit

      - name: Run tests
        run: make test

      - name: Check code coverage
        run: make covcheck

      # TODO
      # - name: Check type annotations
      #   run: make typecheck

      # TODO
      # - name: Check docstring style
      #   run: make doccheck

Revert "Update CI workflow Poetry install"
Revert "Update CI workflow Poetry install"

This reverts commit cfa03a9b0fb53353937c3c7fce86e96d7b6c0b35.
