papermario/.github/workflows/lint.yaml
Alex Bates 6cd56e72c1
fix lint failing on first commit to branch
We now lint ALL files in the repository, not just those detected as changed in the commit (the procedure to do this failed when HEAD was exactly 1 commit ahead of the base branch). Also we now only lint pull requests, not in-progress pushes to any branch.
2020-10-13 20:53:45 +01:00

30 lines
604 B
YAML

name: Lint
on:
pull_request:
paths:
- 'src/*'
- 'include/*'
- 'format.sh'
- '.clang-tidy'
jobs:
build:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install -y astyle clang-tidy
- run: ./format.sh
# Detect any files 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