From 5ecb5f4867f28a4b85227fc8cf4fa43cd2b6ea90 Mon Sep 17 00:00:00 2001 From: Aashna Narula Date: Tue, 6 Feb 2024 12:59:20 +0000 Subject: [PATCH] Update versions --- .github/scripts/run_sonar.sh | 9 +++++++++ .github/workflows/build.yml | 16 +++++++--------- .github/workflows/codeql-analysis.yml | 6 +++--- sonar-project.properties | 13 +++---------- 4 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 .github/scripts/run_sonar.sh diff --git a/.github/scripts/run_sonar.sh b/.github/scripts/run_sonar.sh new file mode 100644 index 0000000..28f3f98 --- /dev/null +++ b/.github/scripts/run_sonar.sh @@ -0,0 +1,9 @@ +sonar-scanner \ + -Dsonar.organization=checkout-ltd \ + -Dsonar.projectKey=checkout_checkout-3ds-sdk-ios \ + -Dsonar.sources=. \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.cfamily.build-wrapper-output.bypass=true \ + -Dsonar.c.file.suffixes=- \ + -Dsonar.cpp.file.suffixes=- \ + -Dsonar.objc.file.suffixes=- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b9e52f..b65ebf4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,26 @@ -name: SonarCloud +name: Run SonarCloud Analysis on: push: branches: - main pull_request: types: [opened, synchronize, reopened] + jobs: build: name: Build and analyze runs-on: macos-latest - env: - BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v2 - - name: Run build-wrapper - run: | - build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild clean build + - 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 }}" + run: sh .github/scripts/run_sonar.sh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6098a71..4c3e9e9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,13 +35,13 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: security-and-quality @@ -51,4 +51,4 @@ jobs: xcodebuild -scheme Checkout3DSPackages -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/sonar-project.properties b/sonar-project.properties index 60b6f11..369b276 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,13 +1,6 @@ sonar.projectKey=checkout_checkout-3ds-sdk-ios sonar.organization=checkout-ltd -# This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=checkout-3ds-sdk-ios -#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 \ No newline at end of file +sonar.sourceEncoding=UTF-8 +sonar.projectVersion=1.0 +sonar.sources=src