-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Static Code Analysis GitHub Action
For now runs clazy, but should get clang-tidy added in the future.
- Loading branch information
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# | ||
# SPDX-FileCopyrightText: 2023 Kai Uwe Broulik <ghqalpha@broulik.de> | ||
|
||
name: Static Code Analysis | ||
|
||
on: ["push", "pull_request"] | ||
|
||
jobs: | ||
static-code-analysis: | ||
strategy: | ||
matrix: | ||
config: | ||
- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"} | ||
|
||
name: ${{matrix.config.name}} | ||
runs-on: ${{matrix.config.os}} | ||
|
||
steps: | ||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: "noninteractive" | ||
run: sudo apt-get update && sudo apt-get install -y build-essential cmake clazy clang-tidy qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev extra-cmake-modules libkf5coreaddons-dev libkf5declarative-dev libkf5sysguard-dev libsensors-dev | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Export Compile Commands | ||
env: | ||
CC: ${{matrix.config.CC}} | ||
CXX: ${{matrix.config.CXX}} | ||
BUILD_DIR: "build/" | ||
run: | | ||
cmake -B ${BUILD_DIR} -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCLAZY_RUN=ON | ||
- name: Clazy | ||
env: | ||
BUILD_DIR: "build/" | ||
run: | | ||
find src/ -name '*.cpp' | xargs clazy-standalone -p ${BUILD_DIR}compile_commands.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,6 @@ bool KCMAlphaCloud::presentationBuild() const | |
#endif | ||
} | ||
|
||
#ifndef CLAZY_RUN | ||
#include "kcm.moc" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,4 +145,6 @@ void SystemStatsPlugin::update() | |
} | ||
} | ||
|
||
#ifndef CLAZY_RUN | ||
#include "plugin.moc" | ||
#endif |