Skip to content

Commit

Permalink
Merge pull request #4 from gongjiu/main
Browse files Browse the repository at this point in the history
add ci test
  • Loading branch information
lvjing2 authored Mar 12, 2024
2 parents d411c5c + 2e7d953 commit bb91112
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/koupleless_runtime_ci_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Koupleless Runtime CI Test
run-name: ${{ github.actor }} pushed code

on:
push:
branches:
- main

pull_request:
branches:
- main

# enable manually running the workflow
workflow_dispatch:

env:
WORK_DIR: .

jobs:
ci-test-for-jdk8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 8
cache: maven

- name: Test
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B -U
&& sh ./check_format.sh
&& mvn test

- name: upload coverage reports to Codecov with github action
uses: codecov/codecov-action@v3

- name: Set up Docker
uses: docker/metadata-action@v3
with:
images: |
node:14
- name: Checkout sampletest Repository
uses: actions/checkout@v3
with:
repository: 'koupleless/samples'
path: 'samples'

- name: get koupleless-runtime version & update koupleless-runtime version for all test sample app
run: |
koupleless_runtime_version=$(find ./koupleless-common -name "*.jar" |grep -v source |sed "s/.*koupleless-common-\(.*\).jar/\1/")
echo "升级 koupleless-runtime version to $koupleless_runtime_version"
for testsample in `find samples -name "*[^3|^dubbo|^dubbo32]-samples"`;do sed -i "s/<koupleless.runtime.version>.*<\/koupleless.runtime.version>/<koupleless.runtime.version>$koupleless_runtime_version<\/koupleless.runtime.version>/g" $testsample/pom.xml ;done
for testsample in `find samples -name "*[^3|^dubbo|^dubbo32]-samples"`;do if cat $testsample/pom.xml |grep "<koupleless.runtime.version>"|grep $koupleless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done
- 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
sudo cp .github/workflows/ccbin/arkctl /usr/bin/arkctl
sudo chmod +x /usr/bin/arkctl
- name: Run jdk8 koupleless runtime test
run: |
set -e
bash -x .github/workflows/ccbin/start.sh jdk8

0 comments on commit bb91112

Please sign in to comment.