Skip to content

Commit

Permalink
add GitHub action (sofastack#182)
Browse files Browse the repository at this point in the history
* Migrate from TravisCI to Github Actions (sofastack#155)

* Create maven.yml

* Update maven.yml

* Update README.md

* Update README.md

* Update README.md

remove personal NickNYU

* Update maven.yml

Update README.md

* split executor in session and data (sofastack#152)

* default disable drop connections

* lint

* start check client version cron

* don't use bolt-default-executor (sofastack#151)

Update README.md

Update README.md

remove personal NickNYU

Co-authored-by: dzdx <[email protected]>
Co-authored-by: 忘禅 <[email protected]>

* Create feature_request.md

* github action

Co-authored-by: Chen <[email protected]>
Co-authored-by: 忘禅 <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2021
1 parent 723ddd9 commit 6cb56e7
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 36 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## In what area(s)?

<!-- Remove the '> ' to select -->

> /area runtime
> /area operator
> /area placement
> /area docs
> /area test-and-release
## Describe the feature
<!-- Please also discuss possible business value -->
26 changes: 26 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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: integration test

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: ut
run: mvn compile -B
&& sh ./tools/check_format.sh
&& mvn clean test -P int "-Dtest.logging.level=ERROR"
28 changes: 28 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -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: unit test

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: ut
run: mvn compile -B
&& sh ./tools/check_format.sh
&& mvn clean test -P unit "-Dtest.logging.level=ERROR"
- name: Codecov
uses: codecov/codecov-action@v1
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
VERSION := $(shell cat VERSION)

proto:
protoc-3.5.1 --proto_path=./server/common/model/src/main/resources/proto --java_out=server/common/model/src/main/java server/common/model/src/main/resources/proto/*.proto
protoc --proto_path=./server/common/model/src/main/resources/proto --java_out=server/common/model/src/main/java server/common/model/src/main/resources/proto/*.proto # protoc-3.5.1

image_build:
docker build . -f docker/Dockerfile -t sofastack/sofaregistry:6.1.4
docker build . -f docker/Dockerfile -t sofastack/sofaregistry:$(VERSION)

image_push:
docker push sofastack/sofaregistry:6.1.4
docker push sofastack/sofaregistry:$(VERSION)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SOFARegistry

[![Build Status](https://travis-ci.com/alipay/sofa-registry.svg?branch=master)](https://travis-ci.com/sofastack/sofa-registry)
[![Java CI with Maven](https://github.com/sofastack/sofa-registry/actions/workflows/maven.yml/badge.svg)](https://github.com/sofastack/sofa-registry/actions/workflows/maven.yml)
![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
[![Coverage Status](https://codecov.io/gh/alipay/sofa-registry/branch/master/graph/badge.svg)](https://codecov.io/gh/sofastack/sofa-registry)
![maven](https://img.shields.io/github/release/sofastack/sofa-registry.svg)
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.1.4
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ignore:
- '**/bootstrap/**'
- '**/inegration/**'
- '**/client/pb/**'
- '**/MetaApplication'
- '**/registry/jraft/**'
- '**/DataApplication'
- '**/SessionApplication'
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,6 @@
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alipay.common</groupId>
<artifactId>tracer</artifactId>
<version>1.0.55</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
Expand Down Expand Up @@ -562,7 +556,7 @@
<version>2.8.1</version>
<configuration>
<!-- 根据JDK版本配置,jdk8: -Xmx1024m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -->
<argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m</argLine>
<argLine>-Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=512m</argLine>
<!--suppress UnresolvedMavenProperty, MavenModelInspection -->
<skipTests>${isSkipUnitTest}</skipTests>
<includes>
Expand Down
2 changes: 1 addition & 1 deletion server/common/util/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Properties>
<Property name="META_LOG_HOME">${sys:user.home}/logs/registry/test</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down
2 changes: 1 addition & 1 deletion server/server/data/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<Properties>
<Property name="LOG_HOME">${sys:user.home}/logs/registry/test</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
package com.alipay.sofa.registry.common.model.slot;

import com.alipay.sofa.registry.server.meta.AbstractMetaServerTestBase;
import com.alipay.sofa.registry.util.FileUtils;
import com.alipay.sofa.registry.util.JsonUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

/**
Expand All @@ -31,9 +27,9 @@ public class BaseSlotFunctionTest extends AbstractMetaServerTestBase {

public String[] getDataInfoIds() {
ArrayList<String> list = new ArrayList<>();
for(int i=0;i<10000;i++){
for (int i = 0; i < 10000; i++) {
list.add(String.format("dataInfoId-%s", i));
}
return list.toArray(new String[]{});
return list.toArray(new String[] {});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public void testChaosLoop() throws Exception {
public void testChaos() throws Exception {
logger.info("[slot-chaos slot] size: " + slotManager.getSlotNums());

do {
chaosRandom = random.nextInt(100);
} while (chaosRandom < 30);
chaosRandom = random.nextInt(20) + 30;

makeMetaLeader();
logger.info("[slot-chaos slot] chaosRandom: " + chaosRandom);
Expand Down
2 changes: 1 addition & 1 deletion server/server/meta/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Properties>
<Property name="META_LOG_HOME">${sys:user.home}/logs/registry/test</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down
2 changes: 1 addition & 1 deletion server/server/session/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Properties>
<Property name="SESSION_LOG_HOME">~/logs/registry/session</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down
7 changes: 1 addition & 6 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@
<version>1.4.200</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alipay.common</groupId>
<artifactId>tracer</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -117,7 +112,7 @@
<configuration>
<testNGArtifactName>none:none</testNGArtifactName>
<junitArtifactName>org.junit:com.springsource.org.junit</junitArtifactName>
<argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Dfile.encoding=UTF8</argLine>
<argLine>-Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=512m -Dfile.encoding=UTF8</argLine>
<includes>
<!-- 指定单元测试执行范围 -->
<include>**/*Test.java</include>
Expand Down
2 changes: 1 addition & 1 deletion test/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Properties>
<Property name="LOG_HOME">${sys:user.home}/logs/registry/test</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.junit.Assert.assertTrue;

import com.alipay.common.tracer.context.AbstractLogContext;
import com.alipay.remoting.Connection;
import com.alipay.sofa.registry.client.api.ConfigDataObserver;
import com.alipay.sofa.registry.client.api.RegistryClientConfig;
Expand Down Expand Up @@ -145,8 +144,6 @@ protected Channel getMetaChannel() {

@BeforeClass
public static void beforeBaseIntegrationClass() throws Exception {
// make sure ctx is exist
Class.forName(AbstractLogContext.class.getName());
System.setProperty(
LoggingSystem.SYSTEM_PROPERTY,
"org.springframework.boot.logging.log4j2.Log4J2LoggingSystem");
Expand Down
4 changes: 3 additions & 1 deletion test/src/test/resources/application-integrate.properties
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ spring.datasource.schema=sql/h2/create_table.sql
#jdbc.typeAliasesPackage=com.alipay.sofa.registry.jdbc.domain
jdbc.mapperLocations=classpath:h2-mapper/*.xml

spring.jmx.enabled=false
spring.jmx.enabled=false
nodes.clusterId=DEFAULT_SEGMENT
nodes.recoverClusterId=RECOVER_DEFAULT_SEGMENT
2 changes: 1 addition & 1 deletion test/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<Properties>
<Property name="LOG_HOME">${sys:user.home}/logs/registry/test</Property>
<Property name="LOG_LEVEL">INFO</Property>
<Property name="LOG_LEVEL">${sys:test.logging.level:-INFO}</Property>
</Properties>

<appenders>
Expand Down

0 comments on commit 6cb56e7

Please sign in to comment.