Hi all
I have a problem with the SonarQube GitHub Action
I have a dashboard → Enterprise Edition v10.6 (92116)
This is my Action
After checkout, install Pod, and install certificates
- name: Build project with build-wrapper
run: |
echo 'Building project with build-wrapper...'
${{ github.workspace }}/sonarqube/build-wrapper/build-wrapper-macosx-x86 --out-dir $BUILD_WRAPPER_OUT_DIR \
xcodebuild \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-derivedDataPath DerivedData/ \
-enableCodeCoverage YES \
-configuration Debug \
-destination 'platform=iOS Simulator,name=${{ vars.DEVICENAME }}' \
clean build test
**********
- name: SwiftLint JSON for SonarQube
continue-on-error: true
run: |
echo ">>> installing swiftlint <<<"
brew install swiftlint
echo ">>> entering source directory <<<"
cd $GITHUB_WORKSPACE
echo ">>> creating swiftlint json file <<<"
touch DerivedData/swiftlint.json
echo ">>> running swiftlint with config file <<<"
swiftlint --config $GITHUB_WORKSPACE/.swiftlint.yml --reporter json > DerivedData/swiftlint.json || true
echo ">>> listing folder <<<"
ls
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-macosx.zip
run: |
mkdir -p $HOME/.sonar
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-5.0.1.3006-macosx/bin" >> $GITHUB_PATH
- name: Analyze with SonarQube
env:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
$HOME/.sonar/sonar-scanner-5.0.1.3006-macosx/bin/sonar-scanner \
-Dsonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" \
-X \
-Dsonar.projectKey=myKey \
-Dsonar.projectName=myKey \
-Dsonar.test.inclusions=**/*Tests/*.swift \
-Dsonar.coverage.exclusions=**/*.xml,Pods/**/*,Reports/**/*,DerivedData/**/*,**/*.html,**/,DerivedData/SourcePackages/** \
-Dsonar.swift.project=MyApp.xcodeproj \
-Dsonar.swift.appName=MyApp \
-Dsonar.swift.appScheme=MyApp \
-Dsonar.swift.appConfiguration=Debug \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.swift.excludePathsFromCoverage=build,DerivedData,fastlane,Pods,reports,xcov_output \
-Dsonar.swift.excludedPathsFromCoverage=.*Tests.*,MyAppTest \
-Dsonar.c.file.suffixes=- \
-Dsonar.objc.file.suffixes=.h,.m \
-Dsonar.cfamily.compile-commands=compile_commands.json \
-Dsonar.swift.swiftlint.reportPaths=DerivedData/swiftlint.json \
-Dsonar.coverageReportPaths=DerivedData/sonarqube-converted.xml \
-Dsonar.cfamily.threads=4 \
-Dsonar.branch.name=development \
-Dsonar.projectVersion=${{env.CURRENT_VERSION_NUMBER}}
I got a lot of errors during Building wrapper
2024-11-13 16:52:01.782 xcodebuild[5945:28878] Writing error result bundle to /var/folders/1y/56hdyx6x0_jb18k7b4ys9b6w0000gn/T/ResultBundle_2024-13-11_16-52-0001.xcresult
xcodebuild: error: Could not resolve package dependencies:
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'build-wrapper: connect to /tmp/build-wrapper-socket.dX7UyI: Operation not permitted
Invalid manifest (compiled with: ["/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-
How can I fix it?
The other steps are right (SwiftLint, sonar scanner download, sonar analyze etc)?
I checked also to sonarsource github but without success
Could you help me?
thanks a lot