name: Check python code style

on:
  push:
    branches: [ main, dev ]
  pull_request:
    branches: [ main, dev ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: 'recursive'
      
    - uses: actions/setup-python@v2
      with:
        python-version: '3.x'

    - name: Setup pip cache
      uses: actions/cache@v2
      timeout-minutes: 5
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-${{ matrix.python-version }}-pip-

    - name: Install deps
      run: |
            pip install -r test-requirements.txt &&
            pip install -e .
      timeout-minutes: 3
      
    - name: Run flake8
      run: python -m flake8 freenom_dns_updater
      timeout-minutes: 20
     
Use github actions to check code style
Use github actions to check code style
