From 2a87a9bc531324837779c98b29616c04265116c7 Mon Sep 17 00:00:00 2001 From: gongjiu <54059581+gongjiu@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:40:47 +0800 Subject: [PATCH 1/6] Create serverless_runtime_release_jdk17.yml --- .../serverless_runtime_release_jdk17.yml | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/serverless_runtime_release_jdk17.yml diff --git a/.github/workflows/serverless_runtime_release_jdk17.yml b/.github/workflows/serverless_runtime_release_jdk17.yml new file mode 100644 index 000000000..32f3cb6fb --- /dev/null +++ b/.github/workflows/serverless_runtime_release_jdk17.yml @@ -0,0 +1,91 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: SOFA Serverless Runtime Release for jdk17 + +## https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release +## trigger manually +on: + workflow_dispatch: + +jobs: + build_and_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Docker + uses: docker/metadata-action@v3 + with: + images: | + node:14 + + - 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/springboot3-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: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Build with Maven + working-directory: sofa-serverless-runtime + run: mvn clean install -DskipTests -B -U -e + + - name: Checkout sampletest Repository + uses: actions/checkout@v3 + with: + repository: 'koupleless/samples' + path: 'samples' + + - name: get sofa-runtime version & update sofa-runtime version for all test sample app + run: | + serverless_runtime_version=$(find sofa-serverless-runtime/sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") + echo "升级sofa-runtime version to $serverless_runtime_version" + for testsample in `find samples -name "*[3]-samples"`;do sed -i "s/.*<\/sofa.serverless.runtime.version>/$serverless_runtime_version<\/sofa.serverless.runtime.version>/g" $testsample/pom.xml ;done + for testsample in `find samples -name "*[3]-samples"`;do if cat $testsample/pom.xml |grep ""|grep $serverless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done + + - name: Run jdk17 serverless runtime test + run: | + set -e + bash .github/workflows/ccbin/start.sh jdk17 + + release_for_jdk17: + needs: build_and_test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Build with Maven + run: mvn --batch-mode deploy -DskipTests -Prelease + working-directory: sofa-serverless-runtime + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} From d4118d4df0655e8641a89eadf55d671ea5e4e742 Mon Sep 17 00:00:00 2001 From: "jijuan.wjj" Date: Mon, 11 Mar 2024 19:47:06 +0800 Subject: [PATCH 2/6] add jdk17 test --- .../serverless_runtime_release_jdk17.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/serverless_runtime_release_jdk17.yml b/.github/workflows/serverless_runtime_release_jdk17.yml index 32f3cb6fb..d1fb3908e 100644 --- a/.github/workflows/serverless_runtime_release_jdk17.yml +++ b/.github/workflows/serverless_runtime_release_jdk17.yml @@ -21,22 +21,6 @@ jobs: images: | node:14 - - 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/springboot3-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: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -54,6 +38,22 @@ jobs: repository: 'koupleless/samples' path: 'samples' + - 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/springboot3-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: get sofa-runtime version & update sofa-runtime version for all test sample app run: | serverless_runtime_version=$(find sofa-serverless-runtime/sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") From 81927042d09470386e0d36c7046707f2d5ad1e50 Mon Sep 17 00:00:00 2001 From: "jijuan.wjj" Date: Mon, 11 Mar 2024 19:51:05 +0800 Subject: [PATCH 3/6] add jdk17 test --- .github/workflows/serverless_runtime_release_jdk17.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/serverless_runtime_release_jdk17.yml b/.github/workflows/serverless_runtime_release_jdk17.yml index d1fb3908e..33368cb1c 100644 --- a/.github/workflows/serverless_runtime_release_jdk17.yml +++ b/.github/workflows/serverless_runtime_release_jdk17.yml @@ -29,7 +29,6 @@ jobs: cache: maven - name: Build with Maven - working-directory: sofa-serverless-runtime run: mvn clean install -DskipTests -B -U -e - name: Checkout sampletest Repository @@ -56,7 +55,7 @@ jobs: - name: get sofa-runtime version & update sofa-runtime version for all test sample app run: | - serverless_runtime_version=$(find sofa-serverless-runtime/sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") + serverless_runtime_version=$(find sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") echo "升级sofa-runtime version to $serverless_runtime_version" for testsample in `find samples -name "*[3]-samples"`;do sed -i "s/.*<\/sofa.serverless.runtime.version>/$serverless_runtime_version<\/sofa.serverless.runtime.version>/g" $testsample/pom.xml ;done for testsample in `find samples -name "*[3]-samples"`;do if cat $testsample/pom.xml |grep ""|grep $serverless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done @@ -84,7 +83,6 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - name: Build with Maven run: mvn --batch-mode deploy -DskipTests -Prelease - working-directory: sofa-serverless-runtime env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} From f64b865bfc4f408f3accb8aca3a3d968fa78ad5e Mon Sep 17 00:00:00 2001 From: "jijuan.wjj" Date: Mon, 11 Mar 2024 20:24:36 +0800 Subject: [PATCH 4/6] add ci test --- .../workflows/koupleless_runtime_ci_test.yml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/koupleless_runtime_ci_test.yml diff --git a/.github/workflows/koupleless_runtime_ci_test.yml b/.github/workflows/koupleless_runtime_ci_test.yml new file mode 100644 index 000000000..a354bf4da --- /dev/null +++ b/.github/workflows/koupleless_runtime_ci_test.yml @@ -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: + unit-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>/g" $testsample/pom.xml ;done + for testsample in `find samples -name "*[^3|^dubbo|^dubbo32]-samples"`;do if cat $testsample/pom.xml |grep ""|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 + From 8addc200105731d463585152069becf5aeca1a12 Mon Sep 17 00:00:00 2001 From: "jijuan.wjj" Date: Mon, 11 Mar 2024 20:31:59 +0800 Subject: [PATCH 5/6] add ci test --- .github/workflows/koupleless_runtime_ci_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/koupleless_runtime_ci_test.yml b/.github/workflows/koupleless_runtime_ci_test.yml index a354bf4da..14c310c9f 100644 --- a/.github/workflows/koupleless_runtime_ci_test.yml +++ b/.github/workflows/koupleless_runtime_ci_test.yml @@ -17,7 +17,7 @@ env: WORK_DIR: . jobs: - unit-test-for-jdk8: + ci-test-for-jdk8: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 2e7d95338dfe6a5a120f3ee35a58e409ff8384bb Mon Sep 17 00:00:00 2001 From: "jijuan.wjj" Date: Tue, 12 Mar 2024 11:30:55 +0800 Subject: [PATCH 6/6] rm jdk17 test pipeline --- .../serverless_runtime_release_jdk17.yml | 89 ------------------- 1 file changed, 89 deletions(-) delete mode 100644 .github/workflows/serverless_runtime_release_jdk17.yml diff --git a/.github/workflows/serverless_runtime_release_jdk17.yml b/.github/workflows/serverless_runtime_release_jdk17.yml deleted file mode 100644 index 33368cb1c..000000000 --- a/.github/workflows/serverless_runtime_release_jdk17.yml +++ /dev/null @@ -1,89 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: SOFA Serverless Runtime Release for jdk17 - -## https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release -## trigger manually -on: - workflow_dispatch: - -jobs: - build_and_test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up Docker - uses: docker/metadata-action@v3 - with: - images: | - node:14 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Build with Maven - run: mvn clean install -DskipTests -B -U -e - - - name: Checkout sampletest Repository - uses: actions/checkout@v3 - with: - repository: 'koupleless/samples' - path: 'samples' - - - 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/springboot3-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: get sofa-runtime version & update sofa-runtime version for all test sample app - run: | - serverless_runtime_version=$(find sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/") - echo "升级sofa-runtime version to $serverless_runtime_version" - for testsample in `find samples -name "*[3]-samples"`;do sed -i "s/.*<\/sofa.serverless.runtime.version>/$serverless_runtime_version<\/sofa.serverless.runtime.version>/g" $testsample/pom.xml ;done - for testsample in `find samples -name "*[3]-samples"`;do if cat $testsample/pom.xml |grep ""|grep $serverless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done - - - name: Run jdk17 serverless runtime test - run: | - set -e - bash .github/workflows/ccbin/start.sh jdk17 - - release_for_jdk17: - needs: build_and_test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - name: Build with Maven - run: mvn --batch-mode deploy -DskipTests -Prelease - env: - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}