Skip to content

Commit

Permalink
Merge pull request #48 from JacobDomagala/47-add-clang-tidy-to-ci
Browse files Browse the repository at this point in the history
Add clang-tidy check to github workflows (#47)
  • Loading branch information
JacobDomagala authored Oct 17, 2020
2 parents d393e49 + 8640b16 commit d36a83f
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none
36 changes: 36 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code quality check

on: [pull_request]

jobs:
code-quality:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup env
run: |
sudo apt-get update
sudo apt-get install -y xorg-dev
sudo apt-get install -y cppcheck
sudo apt-get install -y llvm-dev
sudo apt-get install -y clang-tidy
cmake -E make_directory ${{runner.workspace}}/build
- name: Create compile_commands.json
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .

- name: cppcheck
working-directory: ${{runner.workspace}}/build
run: |
cppcheck src --enable=all --project=compile_commands.json -i$GITHUB_WORKSPACE/lib
- name: clang-tidy
working-directory: ${{runner.workspace}}/build
run: |
run-clang-tidy $GITHUB_WORKSPACE/src
10 changes: 1 addition & 9 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu Full Build
name: Ubuntu full build

on: [push]

Expand Down Expand Up @@ -30,7 +30,6 @@ jobs:
sudo apt-get install -y libc++-9-dev
echo "::set-env name=CXX::clang++-9"
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
Expand All @@ -46,10 +45,3 @@ jobs:
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
12 changes: 1 addition & 11 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows Full Build
name: Windows full build

on: [push]

Expand All @@ -22,9 +22,6 @@ jobs:
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

# - name: Install dependencies
# run: sudo apt-get update && sudo apt-get install xorg-dev

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
Expand All @@ -40,10 +37,3 @@ jobs:
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Windows](https://github.com/JacobDomagala/Shady/workflows/Windows%20Full%20Build/badge.svg)
![Ubuntu](https://github.com/JacobDomagala/Shady/workflows/Ubuntu%20Full%20Build/badge.svg)
![Windows](https://github.com/JacobDomagala/Shady/workflows/Windows%20full%20build/badge.svg)
![Ubuntu](https://github.com/JacobDomagala/Shady/workflows/Ubuntu%20full%20build/badge.svg)

# DEngine
OpenGL graphics engine
Expand Down

0 comments on commit d36a83f

Please sign in to comment.