Skip to content

Sonar

Sonar #103

Workflow file for this run

name: Sonar
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]
schedule:
- cron: 0 16 * * *
workflow_dispatch:
jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2.0'
- name: Install Dependencies
run: >
wget
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-macosx.zip
&& unzip sonar-scanner-cli-5.0.1.3006-macosx.zip && wget
https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip && unzip
build-wrapper-macosx-x86.zip
- name: Run tests
run: >
set -o pipefail && xcodebuild -project
FlickrFinder.xcodeproj -scheme FlickrFinder
-sdk 'iphonesimulator16.2'
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2'
-derivedDataPath Build/ -enableCodeCoverage YES clean build test
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" ONLY_ACTIVE_ARCH=NO |
xcpretty
bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ >
coverage.xml
- name: Sonar
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
run: >
sonar-scanner-5.0.1.3006-macosx/bin/sonar-scanner
-Dsonar.projectName=FlickrFinder
-Dsonar.organization=jeroenbakker-wbd
-Dsonar.projectKey=JeroenBakker-wbd_FlickrFinder
-Dsonar.sources=.
-Dsonar.tests=.
-Dsonar.test.inclusions=**/Tests/**/*
-Dsoner.exclusions=**/Tests/**/*,**/Package.swift,**/*.xml
-Dsonar.swift.project=FlickrFinder.xcodeproj
-Dsonar.swift.scheme=FlickrFinder
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.token=$SONAR_TOKEN
-Dsonar.coverageReportPaths=coverage.xml
-Dsonar.coverage.exclusions=**/Tests/**/*,**/Package.swift
-Dsonar.c.file.suffixes=-
-Dsonar.cpp.file.suffixes=-
-Dsonar.objc.file.suffixes=-