mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
37 lines
799 B
YAML
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
|