-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality]: Enable sonarcloud on CI run (#2676)
- Loading branch information
Showing
8 changed files
with
86 additions
and
10 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,49 @@ | ||
name: Linux CI SonarCloud | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install system dependencies | ||
run: | | ||
# build-essential clang-14 libc++-dev libc++abi-dev ruby-full cmake | ||
sudo apt-get update && sudo apt-get install ninja-build lcov llvm-14 clang-tidy-14 libboost-all-dev --fix-missing | ||
- name: Cache internal dependencies | ||
id: internal_cache | ||
uses: actions/[email protected] | ||
with: | ||
path: build/local | ||
key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }} | ||
- name: Install internal dependencies | ||
run: | | ||
tools/install-dependencies | ||
env: | ||
CC: /usr/bin/clang | ||
CXX: /usr/bin/clang++ | ||
if: steps.internal_cache.outputs.cache-hit != 'true' | ||
- name: Code generation | ||
run: | | ||
tools/generate-files | ||
env: | ||
CC: /usr/bin/clang | ||
CXX: /usr/bin/clang++ | ||
- name: CMake (coverage/clang-tidy/clang-asan) | ||
run: | | ||
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DTW_CODE_COVERAGE=ON -DTW_ENABLE_CLANG_TIDY=ON -DTW_CLANG_ASAN=ON -GNinja | ||
cat build/compile_commands.json | ||
env: | ||
CC: /usr/bin/clang | ||
CXX: /usr/bin/clang++ | ||
- name: SonarCloud Scan | ||
run: | | ||
./tools/sonarcloud-analysis | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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,7 @@ | ||
sonar.organization=trustwallet | ||
sonar.projectKey=TrustWallet_wallet-core | ||
sonar.cfamily.compile-commands=build/compile_commands.json | ||
sonar.cfamily.reportingCppStandardOverride=c++20 | ||
sonar.cfamily.cache.enabled=false | ||
sonar.lang.patterns.cpp=**/*.cc,**/*.cpp,**/*.cxx,**/*.c++,**/*.hh,**/*.hpp,**/*.hxx,**/*.h++,**/*.ipp,**/*.h | ||
sonar.lang.patterns.c=**/*.c |
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
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
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,9 @@ | ||
#Configure here general information about the environment, such as SonarQube server connection details for example | ||
#No information about specific project should appear here | ||
|
||
#----- Default SonarQube server | ||
sonar.host.url=https://sonarcloud.io/ | ||
|
||
#----- Default source code encoding | ||
#sonar.sourceEncoding=UTF-8 | ||
|
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
TARGET=sonar-scanner-cli-4.7.0.2747-linux.zip | ||
TARGET_DIR=sonar-scanner-4.7.0.2747-linux | ||
curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${TARGET} --output ${TARGET} | ||
unzip ${TARGET} | ||
cp tools/sonar-scanner.properties ${TARGET_DIR}/conf | ||
chmod +x ${TARGET_DIR}/bin/sonar-scanner | ||
./${TARGET_DIR}/bin/sonar-scanner |