name: Python

on:
  push:
  pull_request:

jobs:
  build:
    name: Python Linting
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2

    - name: Install Python Deps
      run: python3 -m pip install flake8

    - name: Lint micropython/modules_py
      shell: bash
      run: |
        python3 -m flake8 --ignore E501 micropython/modules_py

    - name: Lint micropython/examples
      shell: bash
      run: |
        python3 -m flake8 --ignore E501 micropython/examples

    - name: Lint .py tools in C++ examples
      shell: bash
      run: |
        python3 -m flake8 --ignore E501 examples