Skip to content

Commit

Permalink
update sonar
Browse files Browse the repository at this point in the history
sonar action in gh is broken - run manually when needed (download artifact, then run sonar-scanner ... )
  • Loading branch information
AlexPerathoner committed Aug 20, 2024
1 parent b51dda7 commit 66a42ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/xcode-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'SlimHUDUITests/**'
push:
paths:
- '.github/**'
- 'SlimHUD/**'
- 'SlimHUDTests/**'
- 'SlimHUDUITests/**'
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
run: |
xcodebuild clean test \
-project SlimHUD.xcodeproj \
-scheme SlimHUD-Unit-Only \
-scheme SlimHUD-GitHub-Action \
-destination platform=macOS \
-resultBundlePath TestResults \
-test-iterations 20 -retry-tests-on-failure \
Expand Down Expand Up @@ -65,15 +66,28 @@ jobs:
fetch-depth: 0
- name: Replace version
run: sed -i '' "s/projectVersion=1.0/projectVersion=$(xcrun agvtool what-version -terse)/g" sonar-project.properties
- uses: actions/download-artifact@master # download all previously generated artifacts
with:
name: sonarqube-generic-coverage
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v8
- name: Run sonarqube
run: |
sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}



# Following steps are broken in GH Action. Download the artifact and run manually if needed
# - uses: actions/download-artifact@master # download all previously generated artifacts
# with:
# name: sonarqube-generic-coverage
# # Setup java 17 to be default (sonar-scanner requirement as of 5.x)
# - uses: actions/setup-java@v3
# with:
# distribution: 'temurin' # See 'Supported distributions' for available options
# java-version: '17'
# - name: Setup sonarqube
# uses: warchant/setup-sonar-scanner@v7
# - name: Run sonarqube
# run: |
# sonar-scanner -X
# -Dsonar.login=${{ secrets.SONAR_TOKEN }}




- name: Check failures
# Flaky tests make the output status generated by xcresulttool not reliable. Using xcodebuild's status directly.
# This means that this workflow could and will fail if some test don't pass, even after retrying them
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sonar.projectKey=AlexPerathoner_SlimHUD
sonar.projectKey=alexpera_slimhud
sonar.organization=alexperathoner

sonar.projectName=SlimHUD
Expand Down

0 comments on commit 66a42ae

Please sign in to comment.