papermario/.github/workflows/lint.yaml
2020-08-19 23:33:22 +01:00

37 lines
799 B
YAML

name: Lint
on:
push:
paths:
- 'src/*'
- 'include/*'
pull_request:
paths:
- 'src/*'
- 'include/*'
jobs:
build:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install -y astyle clang-tidy
# lint files changed by the push/pr
- id: files
uses: trilom/file-changes-action@v1.2.4
with:
output: ' '
- run: ./format.sh ${{ steps.files.outputs.files}}
# fail if any files were changed by ./format.sh
- id: files_formatted
uses: jackton1/find-changed-files@v1.1
with:
files: src, include
- name: Fail if any files reformatted
if: steps.files_formatted.outputs.files_changed == 'true'
run: exit 1