diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..a35c2aa153 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gradle" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000000..1357eb8b53 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,39 @@ +name: SonarCloud +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Test and Test Coverage + run: ./gradlew test jacocoTestReport --info -PenvIsCi=true + - name: Analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew sonarqube -PenvIsCi=true --info \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..263bc6a2e3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic", + "java.format.settings.url": "docs_devel/docs/assets/eclipse-formatting.xml", + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modificationsIfAvailable", + "editor.formatOnPaste": true, +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index f1ca98e892..b9ed1e33c5 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ plugins { id 'com.diffplug.spotless' version '6.0.0' id 'com.github.ben-manes.versions' version '0.39.0' id 'ru.vyarus.mkdocs' version '3.0.0' + id "org.sonarqube" version "3.5.0.2730" } apply from: 'gradle/utils.gradle' @@ -162,7 +163,7 @@ dependencies { // For ed25519 and ecdsa support of jsch, java16+ or BC implementation 'org.bouncycastle:bcprov-jdk15on:1.69' // For ssh agent support of jsch, Java16+ or junixsocket - implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.4.0' + implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.6.2' // For gpg signing implementation 'org.eclipse.jgit:org.eclipse.jgit.gpg.bc:5.11.1.202105131744-r' // For subversion @@ -824,7 +825,7 @@ allprojects { } spotbugs { - reportLevel = 'high' + // reportLevel = 'high' } tasks.findAll { it.name =~ /^spotbugs.*/ }.each { @@ -1145,6 +1146,18 @@ mkdocs { sourcesDir = 'docs_devel' } +sonarqube { + properties { + property "sonar.projectKey", "omegat-sonar_omegat" + property "sonar.organization", "omegat-sonar" + property "sonar.host.url", "https://sonarcloud.io" + property "sonar.java.spotbugs.reportPaths", "build/reports/spotbugs/*.xmll" + property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/*.xml" + property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml" + property "sonar.java.source", "8" + } +} + // Allow setting the max heap size for the run task from the command line, e.g. // `gradle -PrunMaxHeapSize=1024M run` run.maxHeapSize = findProperty('runMaxHeapSize') diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..609a9ced23 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx4096m \ No newline at end of file