mirror of
https://github.com/apache/dubbo.git
synced 2024-10-23 07:04:37 +08:00
Support native ci check (#11358)
* support ci for native Signed-off-by: crazyhzm <crazyhzm@gmail.com> * Change the serialization of native demo to fastjson2 Signed-off-by: crazyhzm <crazyhzm@gmail.com> Signed-off-by: crazyhzm <crazyhzm@gmail.com>
This commit is contained in:
parent
945914b504
commit
704a08d024
42
.github/workflows/build-and-test-pr.yml
vendored
42
.github/workflows/build-and-test-pr.yml
vendored
@ -341,3 +341,45 @@ jobs:
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
|
||||
mv apache-zookeeper-3.7.1-bin/conf/zoo_sample.cfg apache-zookeeper-3.7.1-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
nohup ./target/demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
./target/demo-native-consumer
|
||||
|
@ -350,3 +350,46 @@ jobs:
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
|
||||
mv apache-zookeeper-3.7.1-bin/conf/zoo_sample.cfg apache-zookeeper-3.7.1-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
nohup ./target/demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
./target/demo-native-consumer
|
||||
|
@ -350,3 +350,46 @@ jobs:
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
|
||||
mv apache-zookeeper-3.7.1-bin/conf/zoo_sample.cfg apache-zookeeper-3.7.1-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
nohup ./target/demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
./target/demo-native-consumer
|
||||
|
42
.github/workflows/release-test.yml
vendored
42
.github/workflows/release-test.yml
vendored
@ -346,3 +346,45 @@ jobs:
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
|
||||
mv apache-zookeeper-3.7.1-bin/conf/zoo_sample.cfg apache-zookeeper-3.7.1-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
nohup ./target/demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true
|
||||
./target/demo-native-consumer
|
||||
|
@ -33,7 +33,7 @@ public class Application {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("dubbo.application.logger", "log4j");
|
||||
System.setProperty("native", "true");
|
||||
System.setProperty("dubbo.json-framework.prefer","fastjson");
|
||||
System.setProperty("dubbo.json-framework.prefer", "fastjson");
|
||||
if (isClassic(args)) {
|
||||
runWithRefer();
|
||||
} else {
|
||||
@ -59,9 +59,11 @@ public class Application {
|
||||
reference.setInterface(DemoService.class);
|
||||
reference.setGeneric("false");
|
||||
|
||||
ProtocolConfig protocolConfig = new ProtocolConfig(CommonConstants.DUBBO, -1);
|
||||
protocolConfig.setSerialization("fastjson2");
|
||||
bootstrap.application(applicationConfig)
|
||||
.registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
|
||||
.protocol(new ProtocolConfig(CommonConstants.DUBBO, -1))
|
||||
.protocol(protocolConfig)
|
||||
.reference(reference)
|
||||
.start();
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class Application {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.setProperty("dubbo.application.logger", "log4j");
|
||||
System.setProperty("native", "true");
|
||||
System.setProperty("dubbo.json-framework.prefer","fastjson");
|
||||
System.setProperty("dubbo.json-framework.prefer", "fastjson");
|
||||
if (isClassic(args)) {
|
||||
startWithExport();
|
||||
} else {
|
||||
@ -51,7 +51,7 @@ public class Application {
|
||||
private static void startWithBootstrap() {
|
||||
DubboBootstrap bootstrap = DubboBootstrap.getInstance();
|
||||
|
||||
ApplicationConfig applicationConfig = new ApplicationConfig( "dubbo-demo-api-provider");
|
||||
ApplicationConfig applicationConfig = new ApplicationConfig("dubbo-demo-api-provider");
|
||||
applicationConfig.setQosEnable(false);
|
||||
applicationConfig.setCompiler("jdk");
|
||||
Map<String, String> m = new HashMap<>(1);
|
||||
@ -62,9 +62,11 @@ public class Application {
|
||||
service.setInterface(DemoService.class);
|
||||
service.setRef(new DemoServiceImpl());
|
||||
|
||||
ProtocolConfig protocolConfig = new ProtocolConfig(CommonConstants.DUBBO, -1);
|
||||
protocolConfig.setSerialization("fastjson2");
|
||||
bootstrap.application(applicationConfig)
|
||||
.registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
|
||||
.protocol(new ProtocolConfig(CommonConstants.DUBBO, -1))
|
||||
.protocol(protocolConfig)
|
||||
.service(service)
|
||||
.start()
|
||||
.await();
|
||||
|
Loading…
Reference in New Issue
Block a user