Skip to content

Instantly share code, notes, and snippets.

@codeboy5
Last active May 25, 2020 14:48
Show Gist options
  • Save codeboy5/3588e71bab1615087b014b4b3a7dccce to your computer and use it in GitHub Desktop.
Save codeboy5/3588e71bab1615087b014b4b3a7dccce to your computer and use it in GitHub Desktop.
name: Style check
on:
push:
branches:
- master, dev
pull_request:
types: [opened, synchronize, reopened]
jobs:
python-style-check:
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
cpp-style-check:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v2
- name: Lint with clang-format
run: |
# lint files (all .cpp and .h files) inplace
find ./src/bindings/ -iname *.hpp -o -iname *.cpp -o -iname *.h -o -iname *.cc | 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment