diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..add32073a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "monthly" + groups: + dependencies: + patterns: + - "*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 473f1686f..d8394509c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,9 @@ -# This workflow is designed to build PRs for AHC. Note that it does not actually publish AHC, just builds and test it. +# This workflow builds and tests PRs for AHC. # Docs: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Build PR +permissions: + contents: read on: push: @@ -17,39 +19,51 @@ on: default: 'Github Actions' jobs: - RunOnLinux: + compile-and-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Grant Permission - run: sudo chmod +x ./mvnw - uses: actions/setup-java@v4 with: distribution: 'corretto' java-version: '11' - - name: Run Tests (force Docker tests) - run: ./mvnw -B -ntp clean test -Ddocker.tests=true - - RunOnMacOs: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - name: Grant Permission - run: sudo chmod +x ./mvnw - - uses: actions/setup-java@v4 - with: - distribution: 'corretto' - java-version: '11' - - name: Run Tests (force Docker tests) - run: ./mvnw -B -ntp clean test -Ddocker.tests=true + run: chmod +x ./mvnw + - name: Compile and API compatibility check + run: ./mvnw -B -ntp clean verify -DskipTests -Dgpg.skip=true - RunOnWindows: - runs-on: windows-latest + test: + needs: compile-and-check + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + jdk: [11, 17, 21, 25] + include: + - jdk: 11 + distribution: corretto + - jdk: 17 + distribution: corretto + - jdk: 21 + distribution: corretto + - jdk: 25 + distribution: corretto + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: 'corretto' - java-version: '11' - - name: Run Tests - run: ./mvnw.cmd -B -ntp clean test + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.jdk }} + - name: Grant Permission + if: runner.os != 'Windows' + run: chmod +x ./mvnw + - name: Run Tests (Linux) + if: runner.os == 'Linux' + run: ./mvnw -B -ntp clean test -Ddocker.tests=true + - name: Run Tests (macOS) + if: runner.os == 'macOS' + run: ./mvnw -B -ntp clean test -Dno.docker.tests=true + - name: Run Tests (Windows) + if: runner.os == 'Windows' + run: ./mvnw.cmd -B -ntp clean test "-Dno.docker.tests=true" diff --git a/client/pom.xml b/client/pom.xml index 12c24f666..5d4dede3f 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -180,6 +180,13 @@ test + + io.netty + netty-pkitesting + ${netty.version} + test + + org.testcontainers diff --git a/client/src/test/java/org/asynchttpclient/BasicHttp2Test.java b/client/src/test/java/org/asynchttpclient/BasicHttp2Test.java index b3daaa958..c6fa880b1 100644 --- a/client/src/test/java/org/asynchttpclient/BasicHttp2Test.java +++ b/client/src/test/java/org/asynchttpclient/BasicHttp2Test.java @@ -45,7 +45,8 @@ import io.netty.handler.ssl.ApplicationProtocolNames; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.SelfSignedCertificate; +import io.netty.pkitesting.CertificateBuilder; +import io.netty.pkitesting.X509Bundle; import io.netty.util.concurrent.GlobalEventExecutor; import org.asynchttpclient.test.EventCollectingHandler; import org.junit.jupiter.api.AfterEach; @@ -335,9 +336,12 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { @BeforeEach public void startServer() throws Exception { - SelfSignedCertificate ssc = new SelfSignedCertificate(); + X509Bundle bundle = new CertificateBuilder() + .subject("CN=localhost") + .setIsCertificateAuthority(true) + .buildSelfSigned(); - serverSslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()) + serverSslCtx = SslContextBuilder.forServer(bundle.toKeyManagerFactory()) .applicationProtocolConfig(new ApplicationProtocolConfig( ApplicationProtocolConfig.Protocol.ALPN, ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE, diff --git a/client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartBasicAuthTest.java b/client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartBasicAuthTest.java index 1941ea549..73fdcaa70 100644 --- a/client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartBasicAuthTest.java +++ b/client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartBasicAuthTest.java @@ -62,7 +62,7 @@ public AbstractHandler configureHandler() throws Exception { } private void expectHttpResponse(Function f, int expectedResponseCode) throws Throwable { - File file = createTempFile(1024 * 1024); + File file = createTempFile(1024); try (AsyncHttpClient client = asyncHttpClient()) { Response response = f.apply(client.preparePut(getTargetUrl()).addBodyPart(new FilePart("test", file, APPLICATION_OCTET_STREAM.toString(), UTF_8))) diff --git a/pom.xml b/pom.xml index 16a0e1c55..3efe9e26e 100644 --- a/pom.xml +++ b/pom.xml @@ -429,26 +429,50 @@ - com.github.siom79.japicmp - japicmp-maven-plugin - 0.23.1 + org.revapi + revapi-maven-plugin + 0.15.0 + + + org.revapi + revapi-java + 0.28.1 + + - - RELEASE - ${project.version} - - - true - true - true - false - public - + + org.asynchttpclient:async-http-client:RELEASE + + + ${project.groupId}:${project.artifactId}:${project.version} + + + + - cmp + check verify @@ -456,4 +480,38 @@ + + + + errorprone-jdk25 + + [25,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + --should-stop=ifError=FLOW + + + + com.google.errorprone + error_prone_core + 2.48.0 + + + com.uber.nullaway + nullaway + 0.13.1 + + + + + + + +