diff --git a/.github/actions/sdk-tests/action.yml b/.github/actions/sdk-tests/action.yml new file mode 100644 index 0000000000..e419fec6de --- /dev/null +++ b/.github/actions/sdk-tests/action.yml @@ -0,0 +1,71 @@ +name: 'Run SDK tests' +description: 'Test the SDK using SPM' +inputs: + ssh-private-key: + description: SSH private key + required: true + known-hosts: + description: Known Hosts + required: true + match-password: + description: Match password + required: true + match-git-private-key: + description: Match git private key + required: true + fastlane-password: + description: Fastlane password + required: true + fastlane-session: + description: Fastlane session + required: true + match-keychain-name: + description: Match keychain name + required: true + match-keychain-password: + description: Match keychain password + required: true + source-branch: + description: Source branch + required: true +runs: + using: "composite" + steps: + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + with: + xcode-version: '15.2' + - name: Install SSH key + uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 + with: + key: ${{ inputs.ssh-private-key }} + name: id_rsa_github_actions + known_hosts: ${{ inputs.known-hosts }} + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 + with: + ssh-private-key: ${{ inputs.ssh-private-key }} + - uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 + with: + ruby-version: "3.2" + bundler-cache: true + - name: Build SPM App + shell: bash + run: | + bundle exec fastlane test_spm + env: + MATCH_PASSWORD: ${{ inputs.match-password }} + MATCH_GIT_PRIVATE_KEY: ${{ inputs.ssh-private-key }} + FASTLANE_PASSWORD: ${{ inputs.fastlane-password }} + FASTLANE_SESSION: ${{ inputs.fastlane-session }} + MATCH_KEYCHAIN_NAME: ${{ inputs.match-keychain-name }} + MATCH_KEYCHAIN_PASSWORD: ${{ inputs.match-password }} + SOURCE_BRANCH: ${{ inputs.source-branch }} + - name: Prepare coverage reports + shell: bash + run: | + bash Scripts/xccov-to-sonarqube-generic.sh fastlane/test_output/PrimerSDKTests.xcresult/ > coverage.xml + sed "s#$PWD/##g" coverage.xml > coverage_cleaned.xml + - uses: actions/upload-artifact@master + with: + name: coverage-file + path: coverage_cleaned.xml diff --git a/.github/actions/sonar/action.yml b/.github/actions/sonar/action.yml new file mode 100644 index 0000000000..f240f5ec99 --- /dev/null +++ b/.github/actions/sonar/action.yml @@ -0,0 +1,37 @@ +name: 'Run Sonar tests' +description: 'Upload code quality scans to Sonar' +inputs: + github-token: + description: GitHub token + required: true + sonar-token: + description: Sonar token + required: true + sonar-host: + description: Sonar host URL + required: true +runs: + using: "composite" + steps: + - uses: actions/download-artifact@master + with: + name: coverage-file + - name: Update sonar-project.properties + shell: bash + run: | + echo "sonar.pullrequest.key=${{github.event.pull_request.number}}" >> sonar-project.properties + echo "sonar.pullrequest.branch=${{github.head_ref}}" >> sonar-project.properties + echo "sonar.pullrequest.base=${{github.base_ref}}" >> sonar-project.properties + echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> sonar-project.properties + - name: SonarCloud Scan + uses: sonarsource/sonarqube-scan-action@master + env: + GITHUB_TOKEN: ${{ inputs.github-token }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ inputs.sonar-token }} + SONAR_HOST_URL: ${{ inputs.sonar-host }} + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + env: + SONAR_TOKEN: ${{ inputs.sonar-token }} + SONAR_HOST_URL: ${{ inputs.sonar-host }} diff --git a/.github/workflows/build_test_upload.yml b/.github/workflows/build-test-upload.yml similarity index 73% rename from .github/workflows/build_test_upload.yml rename to .github/workflows/build-test-upload.yml index 13e81fa195..dd410b1b79 100644 --- a/.github/workflows/build_test_upload.yml +++ b/.github/workflows/build-test-upload.yml @@ -6,7 +6,7 @@ on: - opened - synchronize -concurrency: +concurrency: group: ${{ github.ref }}-tests cancel-in-progress: true @@ -21,7 +21,7 @@ jobs: with: ref: ${{ github.ref }} - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: xcode-version: '15.2' - name: Install SSH key @@ -37,7 +37,7 @@ jobs: with: ruby-version: "3.2" bundler-cache: true - - name: Run Unit Tests + - name: Run Unit Tests shell: bash run: | bundle exec fastlane tests @@ -49,7 +49,6 @@ jobs: MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} SOURCE_BRANCH: ${{ github.head_ref }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} sdk-unit-tests: runs-on: macos-13-large timeout-minutes: 20 @@ -63,36 +62,46 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.ref }} - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 - with: - xcode-version: '15.2' - - name: Install SSH key - uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 - with: - key: ${{ secrets.SSH_KEY }} - name: id_rsa_github_actions - known_hosts: ${{ secrets.KNOWN_HOSTS }} - - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 + - name: Run SDK tests + uses: ./.github/actions/sdk-tests with: + github-token: ${{ secrets.GITHUB_TOKEN }} ssh-private-key: ${{ secrets.SSH_KEY }} - - uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 + known-hosts: ${{ secrets.KNOWN_HOSTS }} + match-password: ${{ secrets.MATCH_PASSWORD }} + match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }} + fastlane-session: ${{ secrets.FASTLANE_SESSION }} + fastlane-password: ${{ secrets.FASTLANE_PASSWORD }} + match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }} + match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + + sonarcloud: + needs: + - sdk-unit-tests + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ruby-version: "3.2" - bundler-cache: true - - name: Build SPM App + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@master + with: + name: coverage-file + - name: Update sonar-project.properties run: | - bundle exec fastlane test_spm - env: - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} - FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} - FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - SOURCE_BRANCH: ${{ github.head_ref }} + echo "sonar.pullrequest.key=${{github.event.pull_request.number}}" >> sonar-project.properties + echo "sonar.pullrequest.branch=${{github.head_ref}}" >> sonar-project.properties + echo "sonar.pullrequest.base=${{github.base_ref}}" >> sonar-project.properties + echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> sonar-project.properties + - name: SonarCloud Scan + uses: ./.github/actions/sonar + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + sonar-token: ${{ secrets.SONAR_TOKEN }} + sonar-host: https://sonarcloud.io./ + build-and-upload-to-appetize: - needs: + needs: - debug-app-unit-tests - sdk-unit-tests runs-on: macos-13 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index a15ca24884..0000000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Sonarcloud - -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened] - -jobs: - sonarcloud: - name: SonarCloud - runs-on: ubuntu-latest - if: false - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/test-and-code-quality.yml b/.github/workflows/test-and-code-quality.yml new file mode 100644 index 0000000000..1dd417bf55 --- /dev/null +++ b/.github/workflows/test-and-code-quality.yml @@ -0,0 +1,62 @@ +name: Test SDK and upload Code Quality metrics + +on: + push: + branch: + - master + +concurrency: + group: ${{ github.ref }}-tests + cancel-in-progress: true + +jobs: + sdk-unit-tests: + runs-on: macos-13-large + timeout-minutes: 20 + name: "SDK - Unit Tests" + steps: + - name: Cancel previous jobs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 + with: + access_token: ${{ github.token }} + - name: Git - Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.ref }} + - name: Run SDK tests + uses: ./.github/actions/sdk-tests + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + ssh-private-key: ${{ secrets.SSH_KEY }} + known-hosts: ${{ secrets.KNOWN_HOSTS }} + match-password: ${{ secrets.MATCH_PASSWORD }} + match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }} + fastlane-session: ${{ secrets.FASTLANE_SESSION }} + fastlane-password: ${{ secrets.FASTLANE_PASSWORD }} + match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }} + match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + + sonarcloud: + needs: + - sdk-unit-tests + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@master + with: + name: coverage-file + - name: Update sonar-project.properties + run: | + echo "sonar.pullrequest.key=${{github.event.pull_request.number}}" >> sonar-project.properties + echo "sonar.pullrequest.branch=${{github.head_ref}}" >> sonar-project.properties + echo "sonar.pullrequest.base=${{github.base_ref}}" >> sonar-project.properties + echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> sonar-project.properties + - name: SonarCloud Scan + uses: ./.github/actions/sonar + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + sonar-token: ${{ secrets.SONAR_TOKEN }} + sonar-host: https://sonarcloud.io./ diff --git a/Gemfile.lock b/Gemfile.lock index dcfe5bc8bf..3e8bc94077 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,9 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.6) + CFPropertyList (3.0.7) + base64 + nkf rexml activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) @@ -13,25 +15,26 @@ GEM algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) - artifactory (3.0.15) + artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.876.0) - aws-sdk-core (3.190.1) + aws-partitions (1.917.0) + aws-sdk-core (3.192.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.75.0) - aws-sdk-core (~> 3, >= 3.188.0) + aws-sdk-kms (1.79.0) + aws-sdk-core (~> 3, >= 3.191.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.142.0) - aws-sdk-core (~> 3, >= 3.189.0) + aws-sdk-s3 (1.147.0) + aws-sdk-core (~> 3, >= 3.192.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) + base64 (0.2.0) claide (1.1.0) cocoapods (1.15.2) addressable (~> 2.8) @@ -74,17 +77,17 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20231109) + domain_name (0.6.20240107) dotenv (2.8.1) emoji_regex (3.2.3) escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.108.0) + excon (0.110.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -113,15 +116,15 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.3.0) - fastlane (2.217.0) + fastimage (2.3.1) + fastlane (2.220.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) - colored + colored (~> 1.2) commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) @@ -133,6 +136,7 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) google-cloud-storage (~> 1.31) highline (~> 2.0) http-cookie (~> 1.0.5) @@ -141,10 +145,10 @@ GEM mini_magick (>= 4.9.4, < 5.0.0) multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) - optparse (~> 0.1.1) + optparse (>= 0.1.1, < 1.0.0) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) + security (= 0.1.5) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (~> 3) @@ -153,10 +157,12 @@ GEM word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-browserstack (0.3.2) rest-client (~> 2.0, >= 2.0.2) - fastlane-plugin-firebase_app_distribution (0.3.4) + fastlane-plugin-firebase_app_distribution (0.9.0) + google-apis-firebaseappdistribution_v1 (~> 0.3.0) + google-apis-firebaseappdistribution_v1alpha (~> 0.2.0) fastlane-plugin-versioning (0.5.2) ffi (1.16.3) fourflusher (2.3.1) @@ -164,7 +170,7 @@ GEM gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.2) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -172,30 +178,32 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick + google-apis-firebaseappdistribution_v1 (0.3.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-firebaseappdistribution_v1alpha (0.2.0) + google-apis-core (>= 0.11.0, < 2.a) google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.29.0) + google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.6.1) + google-cloud-core (1.7.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (2.1.0) - faraday (>= 1.0, < 3.a) - google-cloud-errors (1.3.1) - google-cloud-storage (1.45.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.4.0) + google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.29.0) + google-apis-storage_v1 (~> 0.31.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.9.1) - faraday (>= 1.0, < 3.a) - google-cloud-env (~> 2.1) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) multi_json (~> 1.11) os (>= 0.9, < 2.0) @@ -205,29 +213,31 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.7.1) - jwt (2.7.1) - mime-types (3.4.1) + json (2.7.2) + jwt (2.8.1) + base64 + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) + mime-types-data (3.2024.0305) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.22.3) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.3.0) + multipart-post (2.4.0) nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) netrc (0.11.0) - optparse (0.1.1) + nkf (0.2.0) + optparse (0.5.0) os (1.1.4) plist (3.7.1) public_suffix (4.0.7) - rake (13.1.0) + rake (13.2.1) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -243,8 +253,8 @@ GEM ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) - security (0.1.3) - signet (0.18.0) + security (0.1.5) + signet (0.19.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -266,9 +276,8 @@ GEM concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.5.0) - webrick (1.8.1) word_wrap (1.0.0) - xcodeproj (1.23.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -281,11 +290,7 @@ GEM xcpretty (~> 0.2, >= 0.0.7) PLATFORMS - arm64-darwin-22 ruby - universal-darwin-21 - x86_64-darwin-19 - x86_64-darwin-20 DEPENDENCIES activesupport (~> 7.0, <= 7.0.8) @@ -296,4 +301,4 @@ DEPENDENCIES fastlane-plugin-versioning BUNDLED WITH - 2.4.22 + 2.1.4 diff --git a/Scripts/xccov-to-sonarqube-generic.sh b/Scripts/xccov-to-sonarqube-generic.sh new file mode 100644 index 0000000000..b76e1c0a43 --- /dev/null +++ b/Scripts/xccov-to-sonarqube-generic.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -euo pipefail + +function convert_xccov_to_xml { + sed -n \ + -e '/:$/s/&/\&/g;s/^\(.*\):$/ /p' \ + -e 's/^ *\([0-9][0-9]*\): 0.*$/ /p' \ + -e 's/^ *\([0-9][0-9]*\): [1-9].*$/ /p' \ + -e 's/^$/ <\/file>/p' +} + +function xccov_to_generic { + local xcresult="$1" + + echo '' + xcrun xccov view --archive "$xcresult" | convert_xccov_to_xml + echo '' +} + +function check_xcode_version() { + local major=${1:-0} minor=${2:-0} + return $(( (major >= 14) || (major == 13 && minor >= 3) )) +} + +if ! xcode_version="$(xcodebuild -version | sed -n '1s/^Xcode \([0-9.]*\)$/\1/p')"; then + echo 'Failed to get Xcode version' 1>&2 + exit 1 +elif check_xcode_version ${xcode_version//./ }; then + echo "Xcode version '$xcode_version' not supported, version 13.3 or above is required" 1>&2; + exit 1 +fi + +xcresult="$1" +if [[ $# -ne 1 ]]; then + echo "Invalid number of arguments. Expecting 1 path matching '*.xcresult'" + exit 1 +elif [[ ! -d $xcresult ]]; then + echo "Path not found: $xcresult" 1>&2; + exit 1 +elif [[ $xcresult != *".xcresult"* ]]; then + echo "Expecting input to match '*.xcresult', got: $xcresult" 1>&2; + exit 1 +fi + +xccov_to_generic "$xcresult" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 774b0ea8b6..b9a2273950 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -9,9 +9,6 @@ appetize_api_token = ENV['APPETIZE_API_TOKEN'] github_run_id = ENV["GITHUB_RUN_ID"] github_run_number = ENV["GITHUB_RUN_NUMBER"] -# Sonar -sonar_token = ENV["SONAR_TOKEN"] - # Xcode app_workspace = "Debug App/Primer.io Debug App.xcworkspace" @@ -126,19 +123,8 @@ platform :ios do code_coverage: true, output_directory: Dir.pwd + "/test_output" ) - slather( - scheme: "PrimerSDKTests", - workspace: app_workspace, - output_directory: "reports", - proj: app_xcode_proj, - cobertura_xml: "true" - ) - sonar( - sonar_login: sonar_token, - sonar_url: "https://sonarcloud.io" - ) end - + lane :build_cocoapods do |options| common_pre_build_action diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 9e0c38a733..3f046802a3 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -5,5 +5,3 @@ gem 'fastlane-plugin-firebase_app_distribution' gem 'fastlane-plugin-browserstack' gem 'fastlane-plugin-versioning' -gem 'slather' -gem 'sonar' diff --git a/sonar-project.properties b/sonar-project.properties index 90375a2c29..4354ee4a0f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,11 +1,9 @@ # Project core settings sonar.projectKey=primer-sdk-ios sonar.organization=primerio +sonar.host.url=https://sonarcloud.io -# Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 - -# Specifying repo core language sonar.language=swift # Ignoring C types langs @@ -13,8 +11,13 @@ sonar.c.file.suffixes=- sonar.cpp.file.suffixes=- sonar.objc.file.suffixes=- +# Source settings +sonar.sources=Sources +sonar.tests=Tests + +# GitHub +sonar.pullrequest.provider=GitHub +sonar.github.repository=primer-io/primer-sdk-ios -sonar.junit.reportsPath=reports/ -sonar.junit.include=*.junit -sonar.swift.coverage.reportPattern=reports/cobertura.xml -sonar.swift.swiftlint.report=reports/*swiftlint.txt +# Coverage +sonar.coverageReportPaths=coverage_cleaned.xml