diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c0190e..d753e7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,45 +1,54 @@ version: 2 defaults: &defaults working_directory: ~/repo - docker: - - image: circleci/openjdk:8-jdk environment: JVM_OPTS: -Xmx3200m TERM: dumb CI: true -jobs: - build_gradle: - <<: *defaults - - steps: - - checkout - - restore_cache: - keys: +defaults_gradle: &defaults_gradle + steps: + - checkout + - restore_cache: + keys: - gradle-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - gradle-dependencies- + - run: + name: Gradle Dependencies + command: ./gradlew dependencies + - save_cache: + paths: ~/.m2 + key: gradle-dependencies-{{ checksum "build.gradle.kts" }} + - run: + name: Run All Checks + command: ./gradlew check + - store_artifacts: + path: build/reports/ + destination: reports + - store_test_results: + path: build/reports/ - - run: - name: Gradle Dependencies - command: ./gradlew dependencies +jobs: + build_gradle_jdk17: + <<: *defaults - - save_cache: - paths: ~/.gradle - key: gradle-dependencies-{{ checksum "build.gradle.kts" }} + docker: + - image: cimg/openjdk:17.0 - - run: - name: Run All Checks - command: ./gradlew check --scan + <<: *defaults_gradle - - store_artifacts: - path: build/reports/ - destination: reports - - store_test_results: - path: build/reports/ + build_gradle_jdk8: + <<: *defaults + + docker: + - image: cimg/openjdk:8.0 + + <<: *defaults_gradle workflows: version: 2 - build_gradle: + gradle: jobs: - - build_gradle + - build_gradle_jdk8 + - build_gradle_jdk17 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f1ac387..743b298 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,19 +1,45 @@ -name: Java CI with Gradle +name: gradle-ci on: [push, pull_request, workflow_dispatch] jobs: build: - runs-on: ubuntu-latest + env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" + + strategy: + matrix: + java-version: [ 1.8, 11, 17 ] + 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 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle-${{ matrix.java-version }}- + + - name: Test with Gradle + run: ./gradlew build check --stacktrace + + - name: Cleanup Gradle Cache + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.gitignore b/.gitignore index f007981..0742f86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,7 @@ -.vscode/* !.vscode/extensions.json !.vscode/launch.json !.vscode/settings.json !.vscode/tasks.json - -__pycache__ -.classpath -.DS_Store -.gradle -.history -.kobalt -.mtj.tmp/ -.mvn/timing.properties -.mvn/wrapper/maven-wrapper.jar -.nb-gradle -.project -.scannerwork -.settings *.class *.code-workspace *.ctxt @@ -27,7 +12,21 @@ __pycache__ *.sublime-* *.tar.gz *.zip -/**/.idea_modules/ +.DS_Store +.classpath +.gradle +.history +.kobalt +.mtj.tmp/ +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.nb-gradle +.project +.scannerwork +.settings +.vscode/* +/**/.idea/$CACHE_FILE$ +/**/.idea/$PRODUCT_WORKSPACE_FILE$ /**/.idea/**/caches/build_file_checksums.ser /**/.idea/**/contentModel.xml /**/.idea/**/dataSources.ids @@ -48,8 +47,10 @@ __pycache__ /**/.idea/**/uiDesigner.xml /**/.idea/**/usage.statistics.xml /**/.idea/**/workspace.xml -/**/.idea/$CACHE_FILE$ -/**/.idea/$PRODUCT_WORKSPACE_FILE$ +/**/.idea/sonarlint* +/**/.idea_modules/ +Thumbs.db +__pycache__ atlassian-ide-plugin.xml bin/ build/ @@ -63,7 +64,6 @@ dist/ ehthumbs.db fabric.properties gen/ -gradle.properties hs_err_pid* kobaltBuild kobaltw*-test @@ -71,6 +71,7 @@ lib/kotlin* libs/ local.properties out/ +pom.xml.asc pom.xml.next pom.xml.releaseBackup pom.xml.tag @@ -80,5 +81,4 @@ project.properties release.properties target/ test-output -Thumbs.db 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..3ad4dc5 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index d91f848..79ee123 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,5 +1,5 @@ - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 98b5537..56b596e 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -26,5 +26,20 @@