1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
name: Coding Style
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
clang-format:
runs-on: ubuntu-latest
container:
image: opensuse/tumbleweed
steps:
- name: dependencies
run: zypper -n install clang git findutils file
- uses: actions/checkout@v2
- name: format
run: find -type f \( -name "*.[c|h]" -or -name "*.cc" \) -exec clang-format -style=file -i {} \;
- name: verify
run: /bin/bash -c "git status --short | file - | grep empty"
id: verify
- name: diagnostics
if: failure() && steps.verify.outcome == 'failure'
run: git diff
|