name: python-presubmit
on:
  push:
    branches: ['master']
  pull_request:
    paths: ['python/**', '.github/workflows/presubmit-python.yml']

defaults:
  run:
    working-directory: python

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: yapf
        run: |
          python -m pip install --upgrade yapf
          find . -type f -name '*.py' -print0 | \
            xargs -0 --verbose yapf -d --style google
      - name: pylint
        # pylint checks only pyglome/*
        run: |
          python -m pip install --upgrade pylint
          find pyglome -type f -name '*.py' -print0 | \
            xargs -0 --verbose pylint

  unit-test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: [3.6, 3.7, 3.8, 3.9]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Run tests
        run: python -m test

name: python-presubmit
on:
  push:
    branches: ['master']
  pull_request:
    paths: ['python/**', '.github/workflows/presubmit-python.yml']

defaults:
  run:
    working-directory: python

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: yapf
        run: |
          python -m pip install --upgrade yapf
          find . -type f -name '*.py' -print0 | \
            xargs -0 --verbose yapf -d --style google
      - name: pylint
        # pylint checks only pyglome/*
        run: |
          python -m pip install --upgrade pylint
          find pyglome -type f -name '*.py' -print0 | \
            xargs -0 --verbose pylint

  unit-test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ["3.7", "3.8", "3.9", "3.10"]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Run tests
        run: python -m test

Update list of supported Python versions
Update list of supported Python versions

It does not seem to be documented anywhere, but Python 3.6 is not
supported anymore by the Github action.
