lvjing2 pushed code #748
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |