forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrew Shkrob <[email protected]>
- Loading branch information
1 parent
0cd5144
commit d3aaebd
Showing
2 changed files
with
79 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,66 @@ | ||
name: SonarCloud | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
name: Build and analyze | ||
runs-on: ubuntu-22.04 | ||
env: | ||
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | ||
steps: | ||
- name: Free disk space by removing .NET, Android and Haskell | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 100 # enough to get all commits for the current day | ||
|
||
- name: Parallel submodules checkout | ||
shell: bash | ||
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) | ||
|
||
- name: Install sonar-scanner and build-wrapper | ||
uses: SonarSource/sonarcloud-github-c-cpp@v2 | ||
|
||
- name: Install build tools and dependencies | ||
shell: bash | ||
run: | | ||
sudo apt update -y | ||
sudo apt install -y \ | ||
ninja-build \ | ||
libgl1-mesa-dev \ | ||
libglvnd-dev \ | ||
qt6-base-dev \ | ||
libqt6svg6-dev | ||
- name: Configure | ||
shell: bash | ||
run: ./configure.sh | ||
|
||
- name: CMake | ||
shell: bash | ||
env: | ||
CC: clang-14 | ||
CXX: clang++-14 | ||
# -g1 should slightly reduce build time. | ||
run: | | ||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1 | ||
- name: Run build-wrapper | ||
working-directory: build | ||
run: | | ||
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ninja | ||
- name: Run sonar-scanner | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: | | ||
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" |
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,13 @@ | ||
sonar.projectKey=AndrewShkrob_organicmaps | ||
sonar.organization=andrei-shkrob | ||
|
||
# This is the name and version displayed in the SonarCloud UI. | ||
#sonar.projectName=organicmaps | ||
#sonar.projectVersion=1.0 | ||
|
||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
#sonar.sources=. | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
#sonar.sourceEncoding=UTF-8 |