Skip to content

Commit

Permalink
add samples test
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjing2 committed Mar 18, 2024
1 parent 2eea0de commit b75b978
Showing 1 changed file with 206 additions and 0 deletions.
206 changes: 206 additions & 0 deletions .github/workflows/samples_formatter_and_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Koupleless Samples Formatter and Test
run-name: ${{ github.actor }} pushed code

on:
push:
branches:
- main
- runtime-2.0.x
- runtime-2.1.x

pull_request:
branches:
- main
- runtime-2.0.x
- runtime-2.1.x

# enable manually running the workflow
workflow_dispatch:

jobs:
unit-test-for-springboot-samples:
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: 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 for springboot samples
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/springboot-samples/

unit-test-for-sofaboot-samples:
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: 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 for sofaboot samples
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/sofaboot-samples

unit-test-for-dubbo-samples:
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: 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 for dubbo samples
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/dubbo-samples

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'
ref: runtime-2.1.x
token: ${{ secrets.GITHUB_TOKEN }}

- name: Test for dubbo32 samples
run: mvn clean install -DskipTests -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'
ref: runtime-2.0.x
token: ${{ secrets.GITHUB_TOKEN }}

- name: Test for springboot3 samples
run: mvn clean install -DskipTests -Dmaven.javadoc.skip=true -am -B -U
working-directory: samples/springboot3-samples

0 comments on commit b75b978

Please sign in to comment.