papermario/.github/workflows/lint.yaml

36 lines
927 B
YAML

name: Lint
on:
pull_request:
jobs:
cpp_lint:
name: C format and lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Git
run: |
git log --oneline --graph --max-count=100
git log --oneline --graph --max-count=100 HEAD origin/main
- name: clang-format
run: |
git config --global color.ui always
git clang-format-14 --diff origin/main HEAD
git config --global color.ui auto
- name: Lint
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
lines-changed-only: diff
tidy-checks: ''
version: '15'
- name: Fail if lint failed
if: steps.linter.outputs.checks-failed > 0
run: exit 1