Skip to content

Commit

Permalink
Merge pull request chocolate-doom#1471 from turol/improve-ci
Browse files Browse the repository at this point in the history
Improve CI formatting checks
fragglet authored Jun 8, 2022
2 parents 9f14544 + 6e2e500 commit 6e2d5f9
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
@@ -4,23 +4,40 @@ name: cpp-linter

on:
pull_request:
types: [opened, reopened] # let PR-synchronize events be handled by push events
types: [opened, reopened, synchronize]
push:

jobs:
cpp-linter:
strategy:
matrix:
compiler: [clang]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shenxianpeng/cpp-linter-action@v1
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libpng-dev libsamplerate0-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev ninja-build
- name: Run cmake to generate compilation database
run: cmake -S . -B . -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1
- uses: cpp-linter/cpp-linter-action@v1
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
lines-changed-only: true
tidy-checks: >-
boost-*
,bugprone-*
,performance-*
,readability-*
,portability-*
,modernize-*
,clang-analyzer-*
,cppcoreguidelines-*
,-cppcoreguidelines-avoid-magic-numbers
,-readability-magic-numbers
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: |
echo "Some files failed the linting checks!"
run: exit 1

0 comments on commit 6e2d5f9

Please sign in to comment.