I have configured sonarcloud working with github-actions for my swift project and noticed that analysis indicates code coverage 0%.
My sonar-project.properties
contains:
sonar.sources=CityRanks
sonar.exclusions=CityRanks/Shared/CityRanksAPI/**
sonar.tests=CityRanksTests
And here is a workflow:
name: SonarCloud Code Analysis
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
I have found some workaround that depends on xcodebuild to generate code coverage, however it can run only on macos-latest
machine which is not supported by sonarcloud github action for now. How can I resolve that problem?