From 89d6ac590fffca28cc6786982f52426926e02301 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:37:29 +0300 Subject: [PATCH] Bump org.springframework.boot from 3.3.1 to 3.3.3 (#35) * Bump org.springframework.boot from 3.3.1 to 3.3.3 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.3.1 to 3.3.3. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.1...v3.3.3) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * General update + another PR merge * Re-enabling and configuring JaCoCo --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roman Khlebnov --- .github/workflows/build.yml | 33 ++++++------- .github/workflows/pr.yml | 38 --------------- .github/workflows/publish.yml | 48 +++++++++++++++++++ README.md | 4 +- build.gradle | 31 ++++++++++-- gradle.properties | 5 +- .../MultiLevelCacheAutoConfigurationTest.java | 10 ++-- 7 files changed, 103 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/pr.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf24344..bb9d141 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,13 @@ # This workflow will build a Java project with Gradle # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Java CI with Gradle for master branch +name: Java CI with Gradle for general purposes on: workflow_dispatch: {} push: - branches: [ master ] + branches: + - '**' paths-ignore: - '**.yml' - '**.md' @@ -30,6 +31,13 @@ jobs: - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v3 + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages uses: actions/cache@v4 with: @@ -37,21 +45,8 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Run FOSSA license check - uses: fossas/fossa-action@main # Use a specific version if locking is preferred - with: - api-key: ${{ secrets.FOSSA_API_KEY }} - - - name: Build with Gradle - run: ./gradlew spotlessJavaCheck build - - - name: Publish to Maven Central - run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache + - name: Build with Gradle and analyze + run: ./gradlew build sonar --info env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index c21a9d9..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Java CI with Gradle for Pull Requests - -on: - workflow_dispatch: {} - push: - branches-ignore: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v3 - - - name: Cache Gradle packages - uses: actions/cache@v4 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Build with Gradle - run: ./gradlew spotlessJavaCheck build \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fe0c64b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java CI with Gradle for publication on tag creation + +on: + workflow_dispatch: {} + push: + tags: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v3 + + - name: Cache Gradle packages + uses: actions/cache@v4 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Run FOSSA license check + uses: fossas/fossa-action@main # Use a specific version if locking is preferred + with: + api-key: ${{ secrets.FOSSA_API_KEY }} + + - name: Build with Gradle + run: ./gradlew build + + - name: Publish to Maven Central + run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} diff --git a/README.md b/README.md index ec4a6d9..6ad2daa 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ This version does not allow setting most of the local cache properties in favor io.github.suppierk spring-boot-multilevel-cache-starter - 3.3.1.0 + 3.3.3.0 ``` ### Gradle ```groovy -implementation 'io.github.suppierk:spring-boot-multilevel-cache-starter:3.3.1.0' +implementation 'io.github.suppierk:spring-boot-multilevel-cache-starter:3.3.3.0' ``` ## Use cases diff --git a/build.gradle b/build.gradle index 1d6b9d9..fd576ee 100644 --- a/build.gradle +++ b/build.gradle @@ -9,14 +9,15 @@ plugins { id 'java-library' // Core frameworks - id 'org.springframework.boot' version '3.3.1' + id 'org.springframework.boot' version '3.3.3' id 'io.spring.dependency-management' version '1.1.6' // Publishing id 'com.vanniktech.maven.publish' version '0.29.0' // Utility -// id 'jacoco' + id 'jacoco' + id 'org.sonarqube' version '4.4.1.3373' id 'com.diffplug.spotless' version '6.25.0' } @@ -44,7 +45,7 @@ configurations { dependencyManagement { imports { - mavenBom "org.springframework.cloud:spring-cloud-dependencies:2023.0.2" + mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.3' } } @@ -130,3 +131,27 @@ tasks.withType(JavaCompile).configureEach { options.encoding = StandardCharsets.UTF_8.name() dependsOn(spotlessJavaCheck) } + +test { + // Report is always generated after tests run + finalizedBy jacocoTestReport +} + +jacocoTestReport { + // Tests are required to run before generating the report + dependsOn test + + reports { + html.required = true + xml.required = true + csv.required = false + } +} + +sonar { + properties { + property "sonar.projectKey", "SuppieRK_spring-boot-multilevel-cache-starter" + property "sonar.organization", "suppierk" + property "sonar.host.url", "https://sonarcloud.io" + } +} diff --git a/gradle.properties b/gradle.properties index 9f92c89..c4b154a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ SONATYPE_AUTOMATIC_RELEASE=true GROUP=io.github.suppierk POM_ARTIFACT_ID=spring-boot-multilevel-cache-starter -VERSION_NAME=3.3.1.0 +VERSION_NAME=3.3.3.0 POM_PACKAGING=jar POM_NAME=Spring Boot Multilevel Cache Starter @@ -49,3 +49,6 @@ POM_DEVELOPER_URL=https://github.com/SuppieRK/ SONATYPE_CONNECT_TIMEOUT_SECONDS=300 SONATYPE_CLOSE_TIMEOUT_SECONDS=1800 + +# Miscellaneous +systemProp.sonar.gradle.skipCompile=true \ No newline at end of file diff --git a/src/test/java/io/github/suppie/spring/cache/MultiLevelCacheAutoConfigurationTest.java b/src/test/java/io/github/suppie/spring/cache/MultiLevelCacheAutoConfigurationTest.java index 7170d4d..71042fb 100644 --- a/src/test/java/io/github/suppie/spring/cache/MultiLevelCacheAutoConfigurationTest.java +++ b/src/test/java/io/github/suppie/spring/cache/MultiLevelCacheAutoConfigurationTest.java @@ -107,15 +107,19 @@ void instantiationTestWithDifferentCacheTypes(CacheType cacheType) { @MethodSource("localExpirationModes") void instantiationTestWithDifferentLocalExpirationModes( String mode, LocalExpirationMode expected) { - ApplicationContextRunner runner = + ApplicationContextRunner applicationContextRunner = this.runner .withPropertyValues("spring.data.redis.host=" + System.getProperty("HOST")) .withPropertyValues("spring.data.redis.port=" + System.getProperty("PORT")) .withPropertyValues("spring.cache.type=" + CacheType.REDIS.name().toLowerCase()); + if (mode != null) { - runner = runner.withPropertyValues("spring.cache.multilevel.local.expiration-mode=" + mode); + applicationContextRunner = + applicationContextRunner.withPropertyValues( + "spring.cache.multilevel.local.expiration-mode=" + mode); } - runner.run( + + applicationContextRunner.run( context -> { MultiLevelCacheManager cacheManager = context.getBean(MultiLevelCacheManager.class); Assertions.assertThat(cacheManager.getProperties().getLocal().getExpirationMode())