Skip to content

Commit

Permalink
add: qodana static code analysis (opentibiabr#2783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Costallat authored Aug 3, 2024
1 parent 19c55a3 commit 43fdb88
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/analysis-qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Analysis - Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.1
with:
args: --compile-commands,./build/linux-debug/compile_commands.json
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ endif()

set(VCPKG_FEATURE_FLAGS "versions")
set(VCPKG_BUILD_TYPE "release")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


# *****************************************************************************
# Project canary
Expand Down
15 changes: 13 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,19 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"DEBUG_LOG": "ON",
"SPEED_UP_BUILD_UNITY": "OFF",
"ASAN_ENABLED": "ON"
"SPEED_UP_BUILD_UNITY": "OFF"
}
},
{
"name": "linux-debug-asan",
"inherits": "linux-release",
"displayName": "Linux - Debug Build",
"description": "Build Debug Mode With ASAN Enable",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"DEBUG_LOG": "ON",
"ASAN_ENABLED": "ON",
"SPEED_UP_BUILD_UNITY": "OFF"
}
},
{
Expand Down
14 changes: 14 additions & 0 deletions qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
version: "1.0"
bootstrap: |
sudo apt-get update
sudo apt-get install -y cmake git unzip build-essential ca-certificates curl zip unzip tar pkg-config ninja-build autoconf automake libtool python3
cd ~
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
cd /data/project
rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-debug || true

0 comments on commit 43fdb88

Please sign in to comment.