Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sonar scanner to latest 5.x #339

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
137 changes: 63 additions & 74 deletions .github/workflows/masterCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,92 +9,81 @@ on:
jobs:
build:
runs-on: macos-latest
env:
BUILD_WRAPPER_OUT_DIR: DerivedData/compilation-database

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create DerivedData folder
run: mkdir DerivedData

- name: Create DerivedData/compilation-database folder
working-directory: DerivedData
run: mkdir compilation-database

- name: Build RollbarCommon
working-directory: RollbarCommon
run: swift build -v --build-path ../DerivedData

- name: Build RollbarDeploys
working-directory: RollbarDeploys
run: swift build -v

- name: Build RollbarNotifier
working-directory: RollbarNotifier
run: swift build -v

- name: Build RollbarAUL
working-directory: RollbarAUL
run: swift build -v

- name: SonarCloud RollbarCommon
run:
SonarCloud/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir DerivedData/compilation-database
xcodebuild
-workspace RollbarSDK.xcworkspace
-scheme RollbarCommon
-derivedDataPath DerivedData
-enableCodeCoverage YES
build
test
CODE_SIGN_IDENTITY="-"
CODE_SIGNING_REQUIRED=NO
- name: Create build-wrapper dir
run: mkdir -p ${{ env.BUILD_WRAPPER_OUT_DIR }}

# - name: Build RollbarCommon
# working-directory: RollbarCommon
# run: swift build -v

# - name: Build RollbarDeploys
# working-directory: RollbarDeploys
# run: swift build -v

# - name: Build RollbarNotifier
# working-directory: RollbarNotifier
# run: swift build -v

# - name: Build RollbarAUL
# working-directory: RollbarAUL
# run: swift build -v

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
with:
cache-binaries: false

- name: Run build-wrapper RollbarCommon
run: |
xcodebuild \
-workspace RollbarSDK.xcworkspace \
-scheme RollbarCommon \
-derivedDataPath DerivedData \
clean build

- name: Test RollbarCommon
run: |
xcodebuild \
test \
-workspace RollbarSDK.xcworkspace \
-scheme RollbarCommon \
-derivedDataPath DerivedData \
-enableCodeCoverage YES \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO

- name: SonarCloud RollbarDeploys
run:
SonarCloud/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir DerivedData/compilation-database
xcodebuild
-workspace RollbarSDK.xcworkspace
-scheme RollbarDeploys
-derivedDataPath DerivedData
-enableCodeCoverage YES
build
test
CODE_SIGN_IDENTITY="-"
CODE_SIGNING_REQUIRED=NO
run: |
build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild -workspace RollbarSDK.xcworkspace -scheme RollbarDeploys -derivedDataPath DerivedData -enableCodeCoverage YES build test CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO

- name: SonarCloud RollbarNotifier
run:
SonarCloud/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir DerivedData/compilation-database
xcodebuild
-workspace RollbarSDK.xcworkspace
-scheme RollbarNotifier
-derivedDataPath DerivedData
-enableCodeCoverage YES
build
test
CODE_SIGN_IDENTITY="-"
CODE_SIGNING_REQUIRED=NO
run: |
build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild -workspace RollbarSDK.xcworkspace -scheme RollbarNotifier -derivedDataPath DerivedData -enableCodeCoverage YES build test CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO

- name: SonarCloud RollbarAUL
run:
SonarCloud/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir DerivedData/compilation-database
xcodebuild
-workspace RollbarSDK.xcworkspace
-scheme RollbarAUL
-derivedDataPath DerivedData
-enableCodeCoverage YES
build
test
CODE_SIGN_IDENTITY="-"
CODE_SIGNING_REQUIRED=NO

- name: SonarCloud Test Coverage Conversion
run: bash xccov-to-sonarqube-generic.sh DerivedData/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml
run: |
build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild -workspace RollbarSDK.xcworkspace -scheme RollbarAUL -derivedDataPath DerivedData -enableCodeCoverage YES build test CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO

- name: Collect coverage into one XML report
run: |
bash xccov-to-generic.sh DerivedData/Logs/Test/*.xcresult/ > generic-coverage.xml

- name: Run SonarScanner Analysis
run: SonarCloud/sonar-scanner-4.7.0.2747-macosx/bin/sonar-scanner -X -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION_KEY }} -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} -Dsonar.coverageReportPaths=sonarqube-generic-coverage.xml
run: |
sonar-scanner \
-X \
-Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} \
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION_KEY }} \
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} \
-Dsonar.coverageReportPaths=generic-coverage.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion RollbarSDK.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
74 changes: 0 additions & 74 deletions SonarCloud/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner

This file was deleted.

16 changes: 0 additions & 16 deletions SonarCloud/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner-debug

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Loading
Loading