Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clang-tidy check to github workflows (#47) #48

Merged
merged 5 commits into from
Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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