name: lint
on: [push, pull_request]
jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-
      - name: set up python
        uses: actions/setup-python@v1

      - name: install dependencies
        run: |
          pip install -r requirements/development.txt

      - name: lint the source code
        run: make flake8

      - name: check source code formatting
        run: make black

      - name: type check the source code
        run: make type-check

      - name: check version numbers are in sync
        run: make version-check
