Skip to content

Commit

Permalink
Upgrade CI and Sonar Scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Kormanyos committed Oct 29, 2023
1 parent e1ec59a commit bf19ab5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/mandelbrot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c++14, c++17, c++2a ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++-12, clang++-14 ]
standard: [ c++14, c++17, c++20, c++2b ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++ ]
standard: [ c++14, c++17, c++2a ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++ ]
standard: [ c++14, c++2a ]
standard: [ c++14, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -331,7 +331,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++ ]
standard: [ c++14, c++2a ]
standard: [ c++14, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
fail-fast: false
matrix:
compiler: [ g++ ]
standard: [ c++14, c++2a ]
standard: [ c++14, c++20 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/mandelbrot_sonar.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022.
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2023.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -17,7 +17,7 @@ jobs:
name: sonar-gcc-native
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
SONAR_SCANNER_VERSION: 5.0.1.3006
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
Expand Down Expand Up @@ -70,17 +70,18 @@ jobs:
make all
cd ..
mkdir -p images/tmp
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
distribution: 'temurin'
java-version: '17'
overwrite-settings: true
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Download and set up build-wrapper
Expand All @@ -92,10 +93,12 @@ jobs:
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Run build-wrapper
run: |
java -version
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} g++ -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -std=c++2a -I. -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o && g++ test_mandelbrot.o -lpthread -ljpeg-6b -Ljpeg/jpeg-6b-2022/obj -o test_mandelbrot.exe
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
java -version
sonar-scanner -Dsonar.projectKey=ckormanyos_mandelbrot -Dsonar.projectName=mandelbrot --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

0 comments on commit bf19ab5

Please sign in to comment.