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

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: [2.7, 3.6, 3.7, 3.8, pypy2, pypy3]
        
    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/**']

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, pypy3]
        
    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

Remove Python 2 testing, add Python 3.9 testing
Remove Python 2 testing, add Python 3.9 testing
