From eae1d10a3108125c00ddfb0e21d0400b3360d13d Mon Sep 17 00:00:00 2001 From: amvanbaren Date: Wed, 15 Nov 2023 22:26:36 +0200 Subject: [PATCH] java analysis overwrites typescript analysis --- .github/workflows/main.yml | 23 ++++------------------- sonar-project.properties | 4 +++- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f91cb952..4d88e998b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,36 +29,21 @@ jobs: corepack enable corepack prepare yarn@stable --activate - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Sonar needs blame info - name: Set Image Version run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV - - name: SonarCloud Scan webui, cli - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Build CLI run: yarn --cwd cli - name: Build Web UI Image run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui - name: Run Server Tests run: server/gradlew --no-daemon -p server check - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: SonarCloud Scan server + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: server/gradlew --no-daemon -p server build sonar --info - name: Build Server Image run: docker build -t $SERVER_TAG:$IMAGE_VERSION server - name: Push Docker Images diff --git a/sonar-project.properties b/sonar-project.properties index eabec1197..25f0abbdb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,12 +1,14 @@ sonar.projectKey=open-vsx_openvsx sonar.organization=open-vsx +sonar.java.binaries=server/build/classes/java/main +sonar.java.test.binaries=server/build/classes/java/test # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=openvsx #sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -sonar.sources=cli,webui +#sonar.sources=. # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8