-
Notifications
You must be signed in to change notification settings - Fork 24
119 lines (102 loc) · 5.06 KB
/
samples_formatter_and_unit_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Koupleless Samples Formatter and Test
run-name: ${{ github.actor }} pushed code
on:
push:
branches:
- runtime-2.1.x
pull_request:
branches:
- runtime-2.1.x
# enable manually running the workflow
workflow_dispatch:
jobs:
unit-test-for-dubbo32-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
cache: maven
- name: Update Maven version to 3.9.x to enable cross bundle without install
env:
MAVEN_VERSION: '3.9.5'
run: |
wget https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
tar xzvf apache-maven-${MAVEN_VERSION}-bin.tar.gz
echo "MAVEN_HOME=$GITHUB_WORKSPACE/apache-maven-${MAVEN_VERSION}" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/apache-maven-${MAVEN_VERSION}/bin" >> $GITHUB_PATH
- name: Install Runtime
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
- name: Check code formatter
run: sh ./check_format.sh
- name: Checkout Samples Repository
uses: actions/checkout@v3
with:
repository: 'koupleless/samples'
path: 'samples'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Test Env prepare
run: |
sudo apt-get update >>/tmp/envprepare.out
sudo apt-get install -y expect >>/tmp/envprepare.out
docker pull mongo:7.0.2-jammy
docker run --name mongodb -d -p 27017:27017 -v /home/runner/work/data:/data/db mongo:7.0.2-jammy
docker pull zookeeper:3.9.0
docker run -p 2181:2181 -it --name zookeeper --restart always -d zookeeper:3.9.0
docker pull apache/rocketmq:4.9.7
docker run -d -p 9876:9876 -p 10909:10909 -p 10910:10910 -p 10911:10911 -p 10912:10912 -v $(pwd)/samples/springboot-samples/msg/rocketmq/config/start.sh:/home/rocketmq/rocketmq-4.9.7/bin/start.sh -v $(pwd)/samples/springboot-samples/msg/rocketmq/config/broker.conf:/home/rocketmq/rocketmq-4.9.7/bin/broker.conf apache/rocketmq:4.9.7 sh /home/rocketmq/rocketmq-4.9.7/bin/start.sh
sudo apt-get install redis-server -y
sudo systemctl start redis-server
docker compose -f samples/springboot-samples/config/apollo/config/docker-compose.yml up -d
/bin/sh samples/springboot-samples/db/mybatis/config/init_mysql.sh
- name: Test for dubbo32 samples
run: mvn clean install -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/dubbo32-samples
unit-test-for-springboot3-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
cache: maven
- name: Update Maven version to 3.9.x to enable cross bundle without install
env:
MAVEN_VERSION: '3.9.5'
run: |
wget https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
tar xzvf apache-maven-${MAVEN_VERSION}-bin.tar.gz
echo "MAVEN_HOME=$GITHUB_WORKSPACE/apache-maven-${MAVEN_VERSION}" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/apache-maven-${MAVEN_VERSION}/bin" >> $GITHUB_PATH
- name: Install Runtime
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
- name: Check code formatter
run: sh ./check_format.sh
- name: Checkout Samples Repository
uses: actions/checkout@v3
with:
repository: 'koupleless/samples'
path: 'samples'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Test Env prepare
run: |
sudo apt-get update >>/tmp/envprepare.out
sudo apt-get install -y expect >>/tmp/envprepare.out
docker pull mongo:7.0.2-jammy
docker run --name mongodb -d -p 27017:27017 -v /home/runner/work/data:/data/db mongo:7.0.2-jammy
docker pull zookeeper:3.9.0
docker run -p 2181:2181 -it --name zookeeper --restart always -d zookeeper:3.9.0
docker pull apache/rocketmq:4.9.7
docker run -d -p 9876:9876 -p 10909:10909 -p 10910:10910 -p 10911:10911 -p 10912:10912 -v $(pwd)/samples/springboot-samples/msg/rocketmq/config/start.sh:/home/rocketmq/rocketmq-4.9.7/bin/start.sh -v $(pwd)/samples/springboot-samples/msg/rocketmq/config/broker.conf:/home/rocketmq/rocketmq-4.9.7/bin/broker.conf apache/rocketmq:4.9.7 sh /home/rocketmq/rocketmq-4.9.7/bin/start.sh
sudo apt-get install redis-server -y
sudo systemctl start redis-server
docker compose -f samples/springboot-samples/config/apollo/config/docker-compose.yml up -d
/bin/sh samples/springboot-samples/db/mybatis/config/init_mysql.sh
- name: Test for springboot3 samples
run: mvn clean install -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/springboot3-samples