# CI stages to execute against Pull Requests
name: Pylero - CI

on:
  pull_request:
    types: ["opened", "synchronize", "reopened"]

jobs:
  codechecks:
    name: Code Quality
    # The last image version support python3.6, latest have removed it
    # Still need python3.6 for EPEL8
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        python-version: [3.6, 3.8, 3.9, "3.10", "3.11"]
    steps:
      - name: Checkout Pylero
        uses: actions/checkout@v3

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

      - name: Install Dependencies
        run: |
          pip install -U pip
          pip install -U -r requirements.txt
          pip install .

      - name: Pre Commit Checks
        uses: pre-commit/action@v3.0.0
        if: ${{ matrix.python-version != '3.6' }}
