2020-08-18 00:07:13 +02:00
|
|
|
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: ./install.sh
|
|
|
|
|
|
|
|
# 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'
|
2020-08-18 01:35:18 +02:00
|
|
|
run: exit 1
|