Skip to content

Commit

Permalink
Enable sonarlint on pull requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfl28 committed Apr 13, 2024
1 parent f7f1d14 commit 7f8aafb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Sonar
on:
workflow_run:
workflows: [ Build ]
types:
- completed

env:
JAVA_VERSION: '17.0.8+7'
JAVA_DISTRIBUTION: 'temurin'

jobs:
sonar:
name: 'Sonar analysis'
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read # Required to download artifacts
steps:
- name: 'Sonar analysis'
uses: evaristegalois11/sonar-fork-analysis@v1
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
project-key: "mfl28_BoundingBoxEditor"
6 changes: 2 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ jobs:
with:
name: boundingboxeditor-portable-windows
path: build/jpackage/BoundingBoxEditor
- name: Sonarqube analysis
run: ./gradlew sonarqube '-Dsonar.host.url=https://sonarcloud.io' '-Dsonar.login=${{ secrets.SONAR_TOKEN }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Stop Gradle daemons
run: ./gradlew --stop

Expand Down Expand Up @@ -106,6 +102,8 @@ jobs:
run: ./gradlew --info --stacktrace build -x test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: 'Prepare Sonar analysis'
uses: evaristegalois11/sonar-fork-analysis@v1
- name: Test setup
run: |
sudo apt-get install xvfb fluxbox
Expand Down

0 comments on commit 7f8aafb

Please sign in to comment.