Code coverage for ios project using github action

Hai, I am using

  • Developer Edition
  • Version 8.9.9
  • GitHub Actions
  • Languages: Swift

I trying to add code coverage for ios project, for that i am using sonarqube suggested build.yml in github action

---
name: Sonar-Scanner
on:
  # Trigger analysis when pushing in master or pull requests, and when creating
  # a pull request..
  push:
    branches:
      - develop
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  sonarscan:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: SonarQube Scan
      uses: SonarSource/sonarqube-scan-action@v1.1.0
      env:
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}  
        
    # Check the Quality Gate status.
    - name: SonarQube Quality Gate check
      id: sonarqube-quality-gate-check
      uses: sonarsource/sonarqube-quality-gate-action@master
      # Force to fail step after specific time.
      timeout-minutes: 5
      env:
       SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
       SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL

    # Optionally you can use the output from the Quality Gate in another step.
    # The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`.
    - name: "SonarQube Quality Gate Status value"
      run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"

based on the references SonarCloud - Swift code quality scan through GitHub actions

I go through this sonar-scanning-examples/swift-coverage at master · SonarSource/sonar-scanning-examples · GitHub but failed . Any ways add xcode code coverage in this build.yml

Take a look at this thread here:

sure colin.I will try this.

facing this error
xcodebuild: error: Could not resolve package dependencies:

package at -github ‘hackiftekhar/IQKeyboardManager’ 7399efb730eea084571b45a1a9b36a3a3c54c44f is using Swift tools version 5.6.0 but the installed version is 5.5.0

I would guess you face this issue whether you include SonarQube analysis or not – so this error will have to be worked out separately.