Add sonarlint workflow (#51)
This commit is contained in:
parent
ab630c052b
commit
75677dda70
31
.github/workflows/sonarlint.yml
vendored
Normal file
31
.github/workflows/sonarlint.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
on:
|
||||
# Trigger analysis when pushing in master or pull requests, and when creating
|
||||
# a pull request.
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
name: sonarlint
|
||||
jobs:
|
||||
sonarcloud:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
- name: Install sonar-scanner and build-wrapper
|
||||
uses: sonarsource/sonarcloud-github-c-cpp@v2
|
||||
- name: Run build-wrapper
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCPPTRACE_BUILD_DEMO=On -DCPPTRACE_BUILD_TEST=On -DCMAKE_EXPORT_COMPILE_COMMANDS=On
|
||||
make -j
|
||||
cd ..
|
||||
- name: Run sonar-scanner
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: sonar-scanner
|
||||
@ -2,8 +2,9 @@
|
||||
|
||||
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/build.yml)
|
||||
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/test.yml)
|
||||
[](https://sonarcloud.io/summary/new_code?id=jeremy-rifkin_cpptrace)
|
||||
<br/>
|
||||
[-Community%20Discord-blue?labelColor=2C3239&color=7289DA&style=flat&logo=discord&logoColor=959DA5)](https://discord.gg/7kv5AuCndG)
|
||||
[-Community%20Discord-blue?labelColor=2C3239&color=7289DA&style=flat&logo=discord&logoColor=959DA5)](https://discord.gg/frjaAZvqUZ)
|
||||
|
||||
Cpptrace is a simple, portable, and self-contained C++ stacktrace library supporting C++11 and greater on Linux, macOS,
|
||||
and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once.
|
||||
@ -94,7 +95,8 @@ if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET your_target POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:cpptrace> $<TARGET_FILE_DIR:your_target>
|
||||
$<TARGET_FILE:cpptrace>
|
||||
$<TARGET_FILE_DIR:your_target>
|
||||
)
|
||||
endif()
|
||||
```
|
||||
|
||||
8
sonar-project.properties
Normal file
8
sonar-project.properties
Normal file
@ -0,0 +1,8 @@
|
||||
sonar.organization=jeremy-rifkin
|
||||
sonar.projectKey=jeremy-rifkin_cpptrace
|
||||
|
||||
# relative paths to source directories. More details and properties are described
|
||||
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
|
||||
sonar.sources=src
|
||||
sonar.sourceEncoding=UTF-8
|
||||
sonar.cfamily.compile-commands=build/compile_commands.json
|
||||
Loading…
Reference in New Issue
Block a user