From 4777bcc73bb205fd15149ada607828b83c5608d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=91=88=E7=86=B9?= Date: Fri, 29 Jan 2021 11:23:40 +0800 Subject: [PATCH] Use github action instead of travis (#1015) * Use github action instead of travis (#1015) --- .github/workflows/maven.yml | 28 +++++++++++++++++++ README.md | 2 +- pom.xml | 2 +- .../multi/MultiProtocolServerExpTest.java | 10 +++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 000000000..c038a260f --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,28 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: build +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: ./mvnw clean install -Pci-install -B -U -e && sh ./tools/check_format.sh + - name: Test with Maven + run: ./mvnw package -Pci-test + - name: Codecov + uses: codecov/codecov-action@v1 + diff --git a/README.md b/README.md index 14ad98534..be7d41593 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SOFARPC -[![Build Status](https://travis-ci.com/sofastack/sofa-rpc.svg?branch=master)](https://travis-ci.com/sofastack/sofa-rpc) +![Build Status](https://github.com/sofastack/sofa-rpc/workflows/build/badge.svg) [![Coverage Status](https://codecov.io/gh/sofastack/sofa-rpc/branch/master/graph/badge.svg)](https://codecov.io/gh/sofastack/sofa-rpc) ![License](https://img.shields.io/badge/license-Apache--2.0-green.svg) [![Maven](https://img.shields.io/github/release/sofastack/sofa-rpc.svg)](https://github.com/sofastack/sofa-rpc/releases) diff --git a/pom.xml b/pom.xml index b17bcae09..b460e1ba8 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ - gi5.7.7-SNAPSHOT + 5.7.7-SNAPSHOT true true true diff --git a/test/test-integration/src/test/java/com/alipay/sofa/rpc/server/multi/MultiProtocolServerExpTest.java b/test/test-integration/src/test/java/com/alipay/sofa/rpc/server/multi/MultiProtocolServerExpTest.java index cacc0fde7..091fafd54 100644 --- a/test/test-integration/src/test/java/com/alipay/sofa/rpc/server/multi/MultiProtocolServerExpTest.java +++ b/test/test-integration/src/test/java/com/alipay/sofa/rpc/server/multi/MultiProtocolServerExpTest.java @@ -38,6 +38,16 @@ public class MultiProtocolServerExpTest extends ActivelyDestroyTest { @Test public void testMultiProtocolExp() throws NoSuchFieldException { + try { + Field field = DefaultProviderBootstrap.class.getDeclaredField("EXPORTED_KEYS"); + Map map = null; + field.setAccessible(true); + map = (ConcurrentMap) field.get(null); + map.clear(); + } catch (IllegalAccessException e1) { + e1.printStackTrace(); + } + try { // 只有2个线程 执行 ServerConfig serverConfig = new ServerConfig()