Skip to content

Commit 8396403

Browse files
committed
Start updating sonar job
1 parent 038a057 commit 8396403

1 file changed

Lines changed: 32 additions & 52 deletions

File tree

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ------------------------------------------------------------------------------
2-
# Copyright Christopher Kormanyos 2022 - 2025.
2+
# Copyright Christopher Kormanyos 2022 - 2026.
33
# Distributed under the Boost Software License,
44
# Version 1.0. (See accompanying file LICENSE_1_0.txt
55
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -13,56 +13,36 @@ on:
1313
pull_request:
1414
types: [opened, synchronize, reopened]
1515
jobs:
16-
build:
17-
name: sonar-gcc-native
16+
sonar-gcc-native
1817
runs-on: ubuntu-latest
19-
env:
20-
SONAR_SCANNER_VERSION: 5.0.1.3006
21-
SONAR_SERVER_URL: "https://sonarcloud.io"
22-
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
2318
steps:
24-
- uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 0
27-
- name: clone-submods-bootstrap-headers-boost-develop
28-
run: |
29-
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
30-
cd ../boost-root
31-
git submodule update --init tools
32-
git submodule update --init libs/config
33-
git submodule update --init libs/math
34-
git submodule update --init libs/multiprecision
35-
./bootstrap.sh
36-
./b2 headers
37-
- name: Set up JDK 17
38-
uses: actions/setup-java@v4
39-
with:
40-
distribution: 'temurin'
41-
java-version: '17'
42-
overwrite-settings: true
43-
- name: Download and set up sonar-scanner
44-
env:
45-
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
46-
run: |
47-
mkdir -p $HOME/.sonar
48-
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
49-
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
50-
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
51-
- name: Download and set up build-wrapper
52-
env:
53-
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
54-
run: |
55-
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
56-
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
57-
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
58-
- name: Run build-wrapper
59-
run: |
60-
java -version
61-
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} g++ -finline-functions -finline-limit=32 -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wno-cast-function-type -std=c++20 -DWIDE_DECIMAL_NAMESPACE=ckormanyos -I. -I../boost-root -pthread -lpthread test/test.cpp test/test_decwide_t_algebra.cpp test/test_decwide_t_algebra_edge.cpp test/test_decwide_t_examples.cpp examples/example000a_multiply_pi_squared.cpp examples/example000_multiply_nines.cpp examples/example001_roots_sqrt.cpp examples/example001a_roots_seventh.cpp examples/example001b_roots_almost_integer.cpp examples/example001c_roots_sqrt_limb08.cpp examples/example001d_pow2_from_list.cpp examples/example002_pi.cpp examples/example001e_algebra_and_constexpr.cpp examples/example002a_pi_small_limb.cpp examples/example002b_pi_100k.cpp examples/example002c_pi_quintic.cpp examples/example002d_pi_limb08.cpp examples/example003_zeta.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example006_logarithm.cpp examples/example007_catalan_series.cpp examples/example008_bernoulli_tgamma.cpp examples/example009_boost_math_standalone.cpp examples/example009a_boost_math_standalone.cpp examples/example009b_boost_math_standalone.cpp examples/example010_hypergeometric_2f1.cpp examples/example010a_hypergeometric_1f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_rational_floor_ceil.cpp examples/example013_embeddable_sqrt.cpp examples/example013a_embeddable_agm.cpp -o wide_decimal.exe
62-
- name: Run sonar-scanner
63-
env:
64-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
66-
run: |
67-
java -version
68-
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
name: clone-submods-bootstrap-headers-boost-develop
23+
run: |
24+
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
25+
cd ../boost-root
26+
git submodule update --init tools
27+
git submodule update --init libs/config
28+
git submodule update --init libs/math
29+
git submodule update --init libs/multiprecision
30+
./bootstrap.sh
31+
./b2 headers
32+
- name: Install Build Wrapper
33+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
34+
env:
35+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
36+
- name: Run Build Wrapper
37+
run: |
38+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} g++ -finline-functions -finline-limit=32 -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wno-cast-function-type -std=c++20 -DWIDE_DECIMAL_NAMESPACE=ckormanyos -I. -I../boost-root -pthread -lpthread test/test.cpp test/test_decwide_t_algebra.cpp test/test_decwide_t_algebra_edge.cpp test/test_decwide_t_examples.cpp examples/example000a_multiply_pi_squared.cpp examples/example000_multiply_nines.cpp examples/example001_roots_sqrt.cpp examples/example001a_roots_seventh.cpp examples/example001b_roots_almost_integer.cpp examples/example001c_roots_sqrt_limb08.cpp examples/example001d_pow2_from_list.cpp examples/example002_pi.cpp examples/example001e_algebra_and_constexpr.cpp examples/example002a_pi_small_limb.cpp examples/example002b_pi_100k.cpp examples/example002c_pi_quintic.cpp examples/example002d_pi_limb08.cpp examples/example003_zeta.cpp examples/example004_bessel_recur.cpp examples/example005_polylog_series.cpp examples/example006_logarithm.cpp examples/example007_catalan_series.cpp examples/example008_bernoulli_tgamma.cpp examples/example009_boost_math_standalone.cpp examples/example009a_boost_math_standalone.cpp examples/example009b_boost_math_standalone.cpp examples/example010_hypergeometric_2f1.cpp examples/example010a_hypergeometric_1f1.cpp examples/example011_trig_trapezoid_integral.cpp examples/example012_rational_floor_ceil.cpp examples/example013_embeddable_sqrt.cpp examples/example013a_embeddable_agm.cpp -o wide_decimal.exe
39+
- name: SonarQube Scan
40+
uses: SonarSource/sonarqube-scan-action@v6.0.0
41+
env:
42+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43+
with:
44+
args: >
45+
--define sonar.cfamily.compile-commands=${{ runner.workspace }}/build_wrapper_output_directory/compile_commands.json
46+
-Dsonar.organization=ckormanyos
47+
-Dsonar.projectName=wide-decimal
48+
-Dsonar.projectKey=ckormanyos_wide-decimal

0 commit comments

Comments
 (0)