name: Style check

on:
  push:
    branches:
    - master, dev
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: 3.7

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install python dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r ./requirements_dev.txt
        pip install black
    - name: Black pep8 style
      run: |
        black ./ --check
    - name: Lint with clang-format
      run: |
        # lint files (all .cpp and .h files) inplace
        find ./src/bindings/PyDP -iname *.hpp -o -iname *.cpp | xargs clang-format -i -style='file'
        # print changes
        git diff src
        # already well formated if 'git diff' doesn't output
        ! ( git diff src |  grep -q ^ ) || exit 1

name: Style check

on:
  push:
    branches:
    - master, dev
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.7]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install python dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r ./requirements_dev.txt
        pip install black
    - name: Black pep8 style
      run: |
        black ./ --check
    - name: Lint with clang-format
      run: |
        # lint files (all .cpp and .h files) inplace
        find ./src/bindings/PyDP -iname *.hpp -o -iname *.cpp | xargs clang-format -i -style='file'
        # print changes
        git diff src
        # already well formated if 'git diff' doesn't output
        ! ( git diff src |  grep -q ^ ) || exit 1

Fix error on style check workflow file
Fix error on style check workflow file
