Skip to content

Commit

Permalink
Merge pull request #829 from eclipse/sonar
Browse files Browse the repository at this point in the history
Sonar config
  • Loading branch information
amvanbaren authored Nov 15, 2023
2 parents 32d7643 + 58157b1 commit 4ef1499
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,34 @@ jobs:
- uses: actions/checkout@v2
- 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
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
Expand Down
9 changes: 9 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
}
}
plugins {
id "org.sonarqube" version "4.4.1.3373"
id 'nu.studer.jooq' version '8.2.1'
id 'de.undercouch.download' version '5.4.0'
id 'org.springframework.boot' version '3.1.0'
Expand Down Expand Up @@ -123,6 +124,14 @@ dependencies {
gatling "io.gatling:gatling-app:${versions.gatling}"
}

sonar {
properties {
property "sonar.projectKey", "open-vsx_openvsx"
property "sonar.organization", "open-vsx"
property "sonar.host.url", "https://sonarcloud.io"
}
}

jooq {
// use jOOQ version defined in Spring Boot
version = dependencyManagement.importedProperties['jooq.version']
Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=open-vsx_openvsx
sonar.organization=open-vsx

# 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

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

0 comments on commit 4ef1499

Please sign in to comment.