diff --git a/.circleci/config.yml b/.circleci/config.yml index d21cbc7..29685bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,25 +30,25 @@ defaults_gradle: &defaults_gradle path: build/reports/ jobs: - build_gradle_jdk14: + build_gradle_jdk18: <<: *defaults docker: - - image: openjdk:14-jdk + - image: cimg/openjdk:18.0 <<: *defaults_gradle - build_gradle_jdk8: + build_gradle_jdk11: <<: *defaults docker: - - image: circleci/openjdk:8-jdk + - image: cimg/openjdk:11.0 <<: *defaults_gradle workflows: version: 2 gradle: - jobs: - - build_gradle_jdk8 - - build_gradle_jdk14 + jobs: + - build_gradle_jdk11 + - build_gradle_jdk18 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 540b054..ee7e5da 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,21 +1,51 @@ -name: Java CI with Gradle +name: gradle-ci -on: [push, pull_request, workflow_dispatch] +on: [ push, pull_request, workflow_dispatch ] jobs: build: - runs-on: ubuntu-latest + env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" + SONAR_JDK: "17" + + strategy: + matrix: + java-version: [ 11, 17, 20 ] + steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Test with Gradle - run: ./gradlew check - env: - PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }} + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java-version }} + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Cache SonarCloud packages + if: matrix.java-version == env.SONAR_JDK + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Test with Gradle + uses: gradle/gradle-build-action@v2 + env: + PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }} + with: + arguments: build check --stacktrace + + - name: SonarCloud + if: success() && matrix.java-version == env.SONAR_JDK + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew sonar --info diff --git a/.gitignore b/.gitignore index 9dda44b..0742f86 100644 --- a/.gitignore +++ b/.gitignore @@ -2,46 +2,83 @@ !.vscode/launch.json !.vscode/settings.json !.vscode/tasks.json -**/*.class -**/.idea/**/dataSources.ids -**/.idea/**/dataSources.local.xml -**/.idea/**/dataSources/ -**/.idea/**/dbnavigator.xml -**/.idea/**/dictionaries -**/.idea/**/dynamic.xml -**/.idea/**/gradle.xml -**/.idea/**/libraries -**/.idea/**/shelf -**/.idea/**/sqlDataSources.xml -**/.idea/**/tasks.xml -**/.idea/**/uiDesigner.xml -**/.idea/**/usage.statistics.xml -**/.idea/**/workspace.xml +*.class *.code-workspace +*.ctxt *.iws +*.log +*.nar +*.rar *.sublime-* +*.tar.gz +*.zip .DS_Store .classpath .gradle +.history .kobalt +.mtj.tmp/ +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar .nb-gradle .project +.scannerwork .settings .vscode/* -/bin -/build -/deploy -/dist -/gen -/gradle.properties -/local.properties -/out -/proguard-project.txt -/project.properties -/target -/test-output +/**/.idea/$CACHE_FILE$ +/**/.idea/$PRODUCT_WORKSPACE_FILE$ +/**/.idea/**/caches/build_file_checksums.ser +/**/.idea/**/contentModel.xml +/**/.idea/**/dataSources.ids +/**/.idea/**/dataSources.local.xml +/**/.idea/**/dataSources/ +/**/.idea/**/dbnavigator.xml +/**/.idea/**/dictionaries +/**/.idea/**/dynamic.xml +/**/.idea/**/gradle.xml +/**/.idea/**/httpRequests +/**/.idea/**/libraries +/**/.idea/**/mongoSettings.xml +/**/.idea/**/replstate.xml +/**/.idea/**/shelf +/**/.idea/**/shelf/ +/**/.idea/**/sqlDataSources.xml +/**/.idea/**/tasks.xml +/**/.idea/**/uiDesigner.xml +/**/.idea/**/usage.statistics.xml +/**/.idea/**/workspace.xml +/**/.idea/sonarlint* +/**/.idea_modules/ Thumbs.db +__pycache__ +atlassian-ide-plugin.xml +bin/ +build/ +cmake-build-*/ +com_crashlytics_export_strings.xml +crashlytics-build.properties +crashlytics.properties +dependency-reduced-pom.xml +deploy/ +dist/ ehthumbs.db +fabric.properties +gen/ +hs_err_pid* kobaltBuild kobaltw*-test +lib/kotlin* +libs/ +local.properties +out/ pom.xml.asc +pom.xml.next +pom.xml.releaseBackup +pom.xml.tag +pom.xml.versionsBackup +proguard-project.txt +project.properties +release.properties +target/ +test-output +venv diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26820aa..1a3e8b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gradle:alpine +image: gradle:8-jdk11 variables: GRADLE_OPTS: "-Dorg.gradle.daemon=false" @@ -12,7 +12,7 @@ stages: build: stage: build - script: ./gradlew --build-cache assemble + script: gradle --build-cache assemble cache: key: "$CI_COMMIT_REF_NAME" policy: push @@ -22,7 +22,7 @@ build: test: stage: test - script: ./gradlew check + script: gradle check cache: key: "$CI_COMMIT_REF_NAME" policy: pull diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..10aa334 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,298 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index d91f848..6e6eec1 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,5 +1,6 @@ - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 4e8da37..88fa664 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -4,18 +4,9 @@ - - - - - - - - - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8ff795e..562d6ca 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,8 +1,6 @@ \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..dd4c951 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 3d4ac96..646928b 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -21,5 +21,25 @@