diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c02c4103..b20db9791c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,14 +53,27 @@ jobs: matrix: os: [ubuntu-latest] build: - - java: 21 - # deploy profile is included to catch javadoc/SBOM/source-jar issues at PR time - # note this is the publish PROFILE, not PHASE + # latest LTS; the only leg running unit tests and code quality checks + # deploy profile is included to catch javadoc/SBOM/source-jar issues at PR time + # note this is the publish PROFILE, not PHASE + - java: 25 + package: jdk profile: codequality,deploy + # e2e only, on the oldest supported and on JREs (no javac), as in many production images - java: 11 + package: jdk profile: java11 + e2eOnly: true + - java: 25 + package: jre + profile: '' + e2eOnly: true + - java: 11 + package: jre + profile: java11 + e2eOnly: true - name: with Java ${{ matrix.build.java }} + name: ${{ matrix.build.package == 'jre' && 'JRE' || 'JDK' }} ${{ matrix.build.java }}${{ matrix.build.e2eOnly && ' (e2e)' || '' }} runs-on: ${{ matrix.os}} steps: - name: Checkout Repository @@ -68,6 +81,23 @@ jobs: with: submodules: recursive + # installed first so the JDK below stays the default JAVA_HOME for maven + - name: Set up JRE ${{ matrix.build.java }} + if: matrix.build.package == 'jre' + id: jre + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 + with: + java-version: ${{ matrix.build.java }} + java-package: jre + distribution: 'temurin' + + - name: Verify JRE has no javac + if: matrix.build.package == 'jre' + run: | + if "${{ steps.jre.outputs.path }}/bin/java" --list-modules | grep -q '^jdk.compiler@'; then + echo "JRE contains jdk.compiler; tests would not cover the no-javac case" && exit 1 + fi + - name: Set up JDK ${{ matrix.build.java }} uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: @@ -85,4 +115,18 @@ jobs: - name: Maven Verify # Run Maven build with e2e and specific profile, using parallel threads (if some provider decides to use a different toolchain version, this might break) - run: mvn -T 2C --batch-mode --activate-profiles e2e,${{ matrix.build.profile }} clean verify + # jre legs build with the JDK but fork tests onto the JRE + env: + JVM_ARG: ${{ matrix.build.package == 'jre' && format('-Djvm={0}/bin/java', steps.jre.outputs.path) || '' }} + PROFILES: ${{ matrix.build.e2eOnly && format('e2e,e2e-only,{0},!codequality,!deploy', matrix.build.profile) || format('e2e,{0}', matrix.build.profile) }} + run: mvn -T 2C --batch-mode --activate-profiles "$PROFILES" $JVM_ARG clean verify + + # single required check for branch protection, so matrix changes don't require settings changes + build: + name: Build + if: always() + needs: [main] + runs-on: ubuntu-latest + steps: + - name: Check matrix result + run: test "${{ needs.main.result }}" = success diff --git a/pom.xml b/pom.xml index 01e2349766..2c43abff82 100644 --- a/pom.xml +++ b/pom.xml @@ -69,11 +69,12 @@ --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED - false false 11 + + full @@ -333,9 +334,6 @@ true - - full - @@ -466,9 +464,6 @@ true - - full - @@ -614,7 +609,6 @@ [11,) - true @@ -631,34 +625,17 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 3.6.0 - - ${skip.tests} - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.16.0 - - - default-testCompile - test-compile - - testCompile - - - true - - - - + + + e2e-only + + **/e2e/** + false + + diff --git a/tools/flagd-http-connector/src/main/java/dev/openfeature/contrib/tools/flagd/resolver/process/storage/connector/sync/http/HttpConnectorOptions.java b/tools/flagd-http-connector/src/main/java/dev/openfeature/contrib/tools/flagd/resolver/process/storage/connector/sync/http/HttpConnectorOptions.java index 32d993ea9d..2323a24c55 100644 --- a/tools/flagd-http-connector/src/main/java/dev/openfeature/contrib/tools/flagd/resolver/process/storage/connector/sync/http/HttpConnectorOptions.java +++ b/tools/flagd-http-connector/src/main/java/dev/openfeature/contrib/tools/flagd/resolver/process/storage/connector/sync/http/HttpConnectorOptions.java @@ -18,9 +18,7 @@ /** * Represents configuration options for the HTTP connector. */ -@SuppressFBWarnings( - value = {"EI_EXPOSE_REP", "CT_CONSTRUCTOR_THROW"}, - justification = "builder validations") +@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "builder validations") @Slf4j @Getter public class HttpConnectorOptions {