From 4b6959423702160b53684be132978609c0ee6597 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 7 Dec 2020 15:46:22 -0500 Subject: [PATCH] Add GH Actions integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove `.travis.yml` since we rely now on GH Actions for PR checks * Remove all the Travis mentioning when we couldn't pass build because of memory * Fix `Arnaud Cogoluègnes` name in the `@author` list --- .github/workflows/pr-build-workflow.yml | 29 +++++++++++++++++++ .travis.yml | 19 ------------ build.gradle | 7 +---- .../RabbitConnectionFactoryBean.java | 2 +- ...atePublisherCallbacksIntegrationTests.java | 18 +++++------- .../rabbit/retry/MissingIdRetryTests.java | 4 +-- 6 files changed, 41 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/pr-build-workflow.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml new file mode 100644 index 00000000..5aa7760d --- /dev/null +++ b/.github/workflows/pr-build-workflow.yml @@ -0,0 +1,29 @@ +name: Pull Request build + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + services: + rabbitmq: + image: rabbitmq + ports: + - 5672:5672 + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Run Gradle + uses: burrunan/gradle-cache-action@v1 + with: + arguments: check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fdc0e1b9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -dist: trusty -language: java -jdk: oraclejdk8 -sudo: false -services: - - rabbitmq -env: - global: - - GRADLE_OPTS="-Xmx512m" - - TERM=dumb -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ -install: true -script: - - ./gradlew check --no-daemon diff --git a/build.gradle b/build.gradle index 28580164..e1f6dd2c 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,6 @@ plugins { description = 'Spring AMQP' ext { - isTravisBuild = System.getenv().get('TRAVIS') == 'true' linkHomepage = 'https://projects.spring.io/spring-amqp' linkCi = 'https://build.spring.io/browse/AMQP' linkIssue = 'https://jira.spring.io/browse/AMQP' @@ -204,7 +203,7 @@ subprojects { subproject -> } task updateCopyrights { - onlyIf { !System.getenv('TRAVIS') && !System.getenv('bamboo_buildKey') } + onlyIf { !System.getenv('GITHUB_ACTION') && !System.getenv('bamboo_buildKey') } inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) }) outputs.dir('build/classes') @@ -238,10 +237,6 @@ subprojects { subproject -> jacoco { destinationFile = file("$buildDir/jacoco.exec") } - if (isTravisBuild) { - // restrict memory usage, so tests don't fail with exit code 137 on travis - maxHeapSize = '256m' - } } task testAll(type: Test, dependsOn: check) diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitConnectionFactoryBean.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitConnectionFactoryBean.java index cd73eb62..08b1dfd4 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitConnectionFactoryBean.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitConnectionFactoryBean.java @@ -75,7 +75,7 @@ import com.rabbitmq.client.impl.nio.NioParams; * * @author Gary Russell * @author Heath Abelson - * @author Arnaud Cogolu?gnes + * @author Arnaud Cogoluègnes * @author Hareendran * @author Dominique Villard * @author Zachary DeLuca diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplatePublisherCallbacksIntegrationTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplatePublisherCallbacksIntegrationTests.java index 2933d59f..d827284d 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplatePublisherCallbacksIntegrationTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplatePublisherCallbacksIntegrationTests.java @@ -77,7 +77,6 @@ import org.springframework.amqp.utils.test.TestUtils; import org.springframework.beans.DirectFieldAccessor; import org.springframework.expression.Expression; import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.test.context.junit.jupiter.DisabledIf; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; @@ -88,7 +87,7 @@ import com.rabbitmq.client.ConnectionFactory; * @author Gunar Hillert * @author Artem Bilan * @author Rolf Arne Corneliussen - * @author Arnaud Cogolu?gnes + * @author Arnaud Cogoluègnes * @since 1.1 * */ @@ -384,9 +383,9 @@ public class RabbitTemplatePublisherCallbacksIntegrationTests { Thread.currentThread().interrupt(); } template.doSend(channel, "", ROUTE, - new SimpleMessageConverter().toMessage("message", new MessageProperties()), - false, - new CorrelationData("def")); + new SimpleMessageConverter().toMessage("message", new MessageProperties()), + false, + new CorrelationData("def")); threadSentLatch.countDown(); return null; })); @@ -825,14 +824,13 @@ public class RabbitTemplatePublisherCallbacksIntegrationTests { } @Test - @DisabledIf(expression = "#{systemEnvironment['TRAVIS'] ?: false}", reason = "Overflow needs RabbitMQ 3.7") public void testWithFuture() throws Exception { RabbitAdmin admin = new RabbitAdmin(this.connectionFactory); Queue queue = QueueBuilder.nonDurable() - .autoDelete() - .maxLength(1) - .overflow(Overflow.rejectPublish) - .build(); + .autoDelete() + .maxLength(1) + .overflow(Overflow.rejectPublish) + .build(); admin.declareQueue(queue); CorrelationData cd1 = new CorrelationData(); this.templateWithConfirmsEnabled.convertAndSend("", queue.getName(), "foo", cd1); diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/retry/MissingIdRetryTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/retry/MissingIdRetryTests.java index dd783c13..3c24dbdf 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/retry/MissingIdRetryTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/retry/MissingIdRetryTests.java @@ -62,7 +62,7 @@ import org.springframework.retry.support.RetryTemplate; /** * @author Gary Russell - * @author Arnaud Cogolu?gnes + * @author Arnaud Cogoluègnes * @since 1.1.2 * */ @@ -83,7 +83,7 @@ public class MissingIdRetryTests { RabbitAvailableCondition.getBrokerRunning().deleteExchanges("retry.test.exchange"); } - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings("rawtypes") @Test public void testWithNoId() throws Exception { // 2 messages; each retried once by missing id interceptor