This is an automated email from the ASF dual-hosted git repository.
achao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new f38a9c58c8 [feat] mvnd (#6041)
f38a9c58c8 is described below
commit f38a9c58c8aeab6f77a7820c33c7de1673a04f0f
Author: aias00 <[email protected]>
AuthorDate: Thu Oct 9 16:44:05 2025 +0800
[feat] mvnd (#6041)
---
.github/workflows/ci.yml | 47 ++++-
.github/workflows/docker-publish-dockerhub.yml | 36 +++-
.github/workflows/docker-publish.yml | 44 ++++-
.github/workflows/e2e-k8s.yml | 200 ++++++++++++++--------
.github/workflows/integrated-test-k8s-ingress.yml | 84 ++++++++-
.github/workflows/integrated-test.yml | 78 ++++++++-
.github/workflows/k8s-examples-http.yml | 80 ++++++---
7 files changed, 451 insertions(+), 118 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5dc7117a10..e47d28c521 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,8 +25,8 @@ jobs:
build:
strategy:
matrix:
- java: [ 17 ]
- os: [ ubuntu-latest, windows-latest ]
+ java: [17]
+ os: [ubuntu-latest, windows-latest]
include:
- java: 17
os: ubuntu-latest
@@ -82,10 +82,48 @@ jobs:
if: steps.filter.outputs.code == 'true'
with:
java-version: ${{ matrix.java }}
- distribution: 'temurin'
+ distribution: "temurin"
+ - name: Install mvnd
+ if: steps.filter.outputs.code == 'true'
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
+
+ - name: Verify mvnd installation
+ if: steps.filter.outputs.code == 'true'
+ shell: bash
+ run: mvnd --version || echo "mvnd version check failed, will use maven
wrapper as fallback"
+
- name: Build with Maven
if: steps.filter.outputs.code == 'true'
- run: ./mvnw -B clean test -Prelease
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean test -Prelease
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean test -Prelease
+ else
+ ./mvnw -B clean test -Prelease
+ fi
+ fi
- uses: codecov/codecov-action@v1
with:
token: 2760af6a-3405-4882-9e61-04c5176fecfa
@@ -120,4 +158,3 @@ jobs:
- name: checking job status
run: |
[[ "${{ needs.build.result }}" == "success" ]] || exit -1
-
diff --git a/.github/workflows/docker-publish-dockerhub.yml
b/.github/workflows/docker-publish-dockerhub.yml
index 0806b63d09..7ca7a63fad 100644
--- a/.github/workflows/docker-publish-dockerhub.yml
+++ b/.github/workflows/docker-publish-dockerhub.yml
@@ -66,10 +66,42 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: 17
- distribution: 'temurin'
+ distribution: "temurin"
+
+ - name: Install mvnd
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
- name: Build with Maven
- run: ./mvnw -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ else
+ ./mvnw -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ fi
+ fi
- name: Build and push (admin) (dockerhub)
uses: docker/build-push-action@v3
diff --git a/.github/workflows/docker-publish.yml
b/.github/workflows/docker-publish.yml
index 653c524492..e50138fb20 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -17,11 +17,11 @@ name: docker-publish-ghcr
on:
push:
- branches: [ "master" ]
- tags: [ 'v*.*.*' ]
+ branches: ["master"]
+ tags: ["v*.*.*"]
paths-ignore:
- - '**.md'
- - '**/resources/static/'
+ - "**.md"
+ - "**/resources/static/"
env:
REGISTRY: ghcr.io
@@ -70,10 +70,42 @@ jobs:
- uses: actions/setup-java@v4
with:
java-version: 17
- distribution: 'temurin'
+ distribution: "temurin"
+
+ - name: Install mvnd
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
- name: Build with Maven
- run: ./mvnw -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ else
+ ./mvnw -B clean -Prelease -Dmaven.javadoc.skip=true -B
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
+ fi
+ fi
- name: Build and push (admin) (ghcr.io)
uses: docker/build-push-action@v3
diff --git a/.github/workflows/e2e-k8s.yml b/.github/workflows/e2e-k8s.yml
index 3f22fa2a8b..f1a479d383 100644
--- a/.github/workflows/e2e-k8s.yml
+++ b/.github/workflows/e2e-k8s.yml
@@ -81,29 +81,59 @@ jobs:
- name: Set up JDK 17 for Building ShenYu
uses: actions/setup-java@v4
with:
- java-version: '17'
- distribution: 'temurin'
+ java-version: "17"
+ distribution: "temurin"
+
+ - name: Install mvnd
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
- name: Build with Maven
- run: ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -B -Drat.skip=true -Dmaven.test.skip=true
-Djacoco.skip=true -DskipITs -DskipTests package -T1C
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean install -Prelease,docker -Dmaven.javadoc.skip=true
-B -Drat.skip=true -Dmaven.test.skip=true -Djacoco.skip=true -DskipITs
-DskipTests package -T1C
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -B -Drat.skip=true -Dmaven.test.skip=true
-Djacoco.skip=true -DskipITs -DskipTests package -T1C
+ else
+ ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -B -Drat.skip=true -Dmaven.test.skip=true
-Djacoco.skip=true -DskipITs -DskipTests package -T1C
+ fi
+ fi
- name: Save ShenYu Maven Repos
uses: actions/cache/save@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
-# - name: Build shenyu-e2e-engine with Maven
-# run: ./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-engine -am
clean install
+ # - name: Build shenyu-e2e-engine with Maven
+ # run: ./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-engine
-am clean install
-# - name: Save ShenYu E2E Maven Repos
-# if: steps.restore-e2e-maven-cache.outputs.cache-hit != 'true'
-# uses: actions/cache/save@v3
-# with:
-# path: ~/.m2/repository
-# key: ${{ runner.os }}-e2e-maven-${{ hashFiles('**/pom.xml') }}
+ # - name: Save ShenYu E2E Maven Repos
+ # if: steps.restore-e2e-maven-cache.outputs.cache-hit != 'true'
+ # uses: actions/cache/save@v3
+ # with:
+ # path: ~/.m2/repository
+ # key: ${{ runner.os }}-e2e-maven-${{ hashFiles('**/pom.xml') }}
- name: Build Docker Image
run: |
@@ -123,7 +153,7 @@ jobs:
- changes
- build-docker-images
if: (github.repository == 'apache/shenyu' && ${{ needs.changes.outputs.e2e
== 'true' }})
-# if: (github.repository == 'apache/shenyu')
+ # if: (github.repository == 'apache/shenyu')
strategy:
matrix:
include:
@@ -152,19 +182,19 @@ jobs:
rm -rf /tmp/shenyu
mkdir -p /tmp/shenyu
-# - name: Install k8s
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.6+k3s2
K3S_KUBECONFIG_MODE=777 sh -
-# cat /etc/rancher/k3s/k3s.yaml
-# mkdir -p ~/.kube
-# cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
+ # - name: Install k8s
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # curl -sfL https://get.k3s.io |
INSTALL_K3S_VERSION=v1.29.6+k3s2 K3S_KUBECONFIG_MODE=777 sh -
+ # cat /etc/rancher/k3s/k3s.yaml
+ # mkdir -p ~/.kube
+ # cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
- name: Set up JDK 17 for Building ShenYu
uses: actions/setup-java@v4
with:
- java-version: '17'
- distribution: 'temurin'
+ java-version: "17"
+ distribution: "temurin"
- name: Restore ShenYu Maven Repos
uses: actions/cache/restore@v3
@@ -178,28 +208,28 @@ jobs:
with:
name: shenyu-images
path: /tmp/shenyu/
-
+
- name: Load ShenYu Docker Images
run: |
docker load --input /tmp/shenyu/apache-shenyu-admin.tar
docker load --input /tmp/shenyu/apache-shenyu-bootstrap.tar
docker image ls -a
-# - name: Build k8s Cluster
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# sudo k3s ctr images import /tmp/shenyu/apache-shenyu-admin.tar
-# sudo k3s ctr images import /tmp/shenyu/apache-shenyu-bootstrap.tar
+ # - name: Build k8s Cluster
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # sudo k3s ctr images import /tmp/shenyu/apache-shenyu-admin.tar
+ # sudo k3s ctr images import
/tmp/shenyu/apache-shenyu-bootstrap.tar
- name: Run E2E Tests
run: |
bash ./shenyu-e2e/shenyu-e2e-case/${{ matrix.case
}}/compose/script/${{ matrix.script }}.sh
-# - name: Cluster Test after Healthcheck
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# kubectl get all
-# kubectl get events --all-namespaces
+ # - name: Cluster Test after Healthcheck
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # kubectl get all
+ # kubectl get events --all-namespaces
e2e-case:
runs-on: ubuntu-latest
@@ -207,7 +237,7 @@ jobs:
- changes
- build-docker-images
if: (github.repository == 'apache/shenyu' && ${{ needs.changes.outputs.e2e
== 'true' }})
-# if: (github.repository == 'apache/shenyu')
+ # if: (github.repository == 'apache/shenyu')
strategy:
matrix:
include:
@@ -231,7 +261,7 @@ jobs:
script: e2e-logging-rocketmq-compose
# - case: shenyu-e2e-case-logging-kafka
# script: e2e-logging-kafka-compose
-
+
steps:
- uses: actions/checkout@v2
with:
@@ -249,19 +279,19 @@ jobs:
rm -rf /tmp/shenyu
mkdir -p /tmp/shenyu
-# - name: Install k8s
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.6+k3s2
K3S_KUBECONFIG_MODE=777 sh -
-# cat /etc/rancher/k3s/k3s.yaml
-# mkdir -p ~/.kube
-# cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
+ # - name: Install k8s
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # curl -sfL https://get.k3s.io |
INSTALL_K3S_VERSION=v1.29.6+k3s2 K3S_KUBECONFIG_MODE=777 sh -
+ # cat /etc/rancher/k3s/k3s.yaml
+ # mkdir -p ~/.kube
+ # cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
- name: Set up JDK 17 for Building ShenYu
uses: actions/setup-java@v4
with:
- java-version: '17'
- distribution: 'temurin'
+ java-version: "17"
+ distribution: "temurin"
- name: Restore ShenYu Maven Repos
uses: actions/cache/restore@v3
@@ -270,22 +300,54 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
-
+
+ - name: Install mvnd
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
+
- uses: actions/download-artifact@v4
with:
name: shenyu-images
path: /tmp/shenyu/
-# - name: Restore ShenYu E2E Maven Repos
-# uses: actions/cache/restore@v3
-# with:
-# path: ~/.m2/repository
-# key: ${{ runner.os }}-e2e-maven-${{ hashFiles('**/pom.xml') }}
-# restore-keys: |
-# ${{ runner.os }}-e2e-maven-
+ # - name: Restore ShenYu E2E Maven Repos
+ # uses: actions/cache/restore@v3
+ # with:
+ # path: ~/.m2/repository
+ # key: ${{ runner.os }}-e2e-maven-${{ hashFiles('**/pom.xml') }}
+ # restore-keys: |
+ # ${{ runner.os }}-e2e-maven-
- name: Build examples with Maven
- run: ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build examples"
+ mvnd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ echo "Falling back to maven wrapper for examples"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ fi
+ fi
- uses: actions/download-artifact@v4
with:
@@ -298,27 +360,27 @@ jobs:
docker load --input /tmp/shenyu/apache-shenyu-bootstrap.tar
docker image ls -a
-# - name: Build k8s Cluster
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# sudo k3s ctr images import /tmp/shenyu/apache-shenyu-admin.tar
-# sudo k3s ctr images import /tmp/shenyu/apache-shenyu-bootstrap.tar
+ # - name: Build k8s Cluster
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # sudo k3s ctr images import /tmp/shenyu/apache-shenyu-admin.tar
+ # sudo k3s ctr images import
/tmp/shenyu/apache-shenyu-bootstrap.tar
-# - name: Setup Debug Session
-# uses: mxschmitt/action-tmate@v3
-# timeout-minutes: 15
-# with:
-# detached: true
+ # - name: Setup Debug Session
+ # uses: mxschmitt/action-tmate@v3
+ # timeout-minutes: 15
+ # with:
+ # detached: true
- name: Run E2E Tests
run: |
bash ./shenyu-e2e/shenyu-e2e-case/${{ matrix.case
}}/compose/script/${{ matrix.script }}.sh
-# - name: Cluster Test after Healthcheck
-# if: steps.filter.outputs.changed == 'true'
-# run: |
-# kubectl get all
-# kubectl get events --all-namespaces
+ # - name: Cluster Test after Healthcheck
+ # if: steps.filter.outputs.changed == 'true'
+ # run: |
+ # kubectl get all
+ # kubectl get events --all-namespaces
requirement:
name: e2e
diff --git a/.github/workflows/integrated-test-k8s-ingress.yml
b/.github/workflows/integrated-test-k8s-ingress.yml
index a4ce5dd560..c6aa33c88b 100644
--- a/.github/workflows/integrated-test-k8s-ingress.yml
+++ b/.github/workflows/integrated-test-k8s-ingress.yml
@@ -31,7 +31,7 @@ jobs:
- shenyu-integrated-test-k8s-ingress-motan
- shenyu-integrated-test-k8s-ingress-websocket
- shenyu-integrated-test-k8s-ingress-grpc
-# - shenyu-integrated-test-k8s-ingress-sofa
+ # - shenyu-integrated-test-k8s-ingress-sofa
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu'
steps:
@@ -81,7 +81,7 @@ jobs:
if: steps.filter.outputs.k8s-ingress == 'true'
with:
java-version: 17
- distribution: 'temurin'
+ distribution: "temurin"
- name: Install Go
uses: actions/setup-go@v3
@@ -108,19 +108,76 @@ jobs:
if: steps.filter.outputs.k8s-ingress == 'true'
with:
java-version: 17
- distribution: 'temurin'
+ distribution: "temurin"
+
+ - name: Install mvnd
+ if: steps.filter.outputs.k8s-ingress == 'true'
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
- name: Build with Maven
if: steps.filter.outputs.k8s-ingress == 'true'
- run: ./mvnw -B clean install -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean install -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ else
+ ./mvnw -B clean install -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ fi
+ fi
- name: Build integrated tests
if: steps.filter.outputs.k8s-ingress == 'true'
- run: ./mvnw -B clean install -Pit -DskipTests -am -f
./shenyu-integrated-test/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build integrated tests"
+ mvnd -B clean install -Pit -DskipTests -am -f
./shenyu-integrated-test/pom.xml
+ else
+ echo "Falling back to maven wrapper for integrated tests"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pit -DskipTests -am -f
./shenyu-integrated-test/pom.xml
+ else
+ ./mvnw -B clean install -Pit -DskipTests -am -f
./shenyu-integrated-test/pom.xml
+ fi
+ fi
- name: Build examples
if: steps.filter.outputs.k8s-ingress == 'true'
- run: ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build examples"
+ mvnd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ echo "Falling back to maven wrapper for examples"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ fi
+ fi
- name: Build k8s Cluster
if: steps.filter.outputs.k8s-ingress == 'true'
@@ -135,7 +192,19 @@ jobs:
- name: Run test
id: test
if: steps.filter.outputs.k8s-ingress == 'true'
- run: ./mvnw test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for running tests"
+ mvnd test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ else
+ echo "Falling back to maven wrapper for tests"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ else
+ ./mvnw test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ fi
+ fi
continue-on-error: true
- name: Cluster Test after Healthcheck
@@ -156,4 +225,3 @@ jobs:
echo "Test Successful"
exit 0
fi
-
diff --git a/.github/workflows/integrated-test.yml
b/.github/workflows/integrated-test.yml
index 233ef586f4..9afc310f1c 100644
--- a/.github/workflows/integrated-test.yml
+++ b/.github/workflows/integrated-test.yml
@@ -87,16 +87,72 @@ jobs:
if: steps.filter.outputs.integration == 'true'
with:
java-version: 17
- distribution: 'temurin'
+ distribution: "temurin"
+ - name: Install mvnd
+ if: steps.filter.outputs.integration == 'true'
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
- name: Build with Maven
if: steps.filter.outputs.integration == 'true'
- run: ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean install -Prelease,docker -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ else
+ ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ fi
+ fi
- name: Build examples
if: steps.filter.outputs.integration == 'true'
- run: ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build examples"
+ mvnd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ echo "Falling back to maven wrapper for examples"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ else
+ ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ fi
+ fi
- name: Build integrated tests
if: steps.filter.outputs.integration == 'true'
- run: ./mvnw -B clean install -Pit -DskipTests -f
./shenyu-integrated-test/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build integrated tests"
+ mvnd -B clean install -Pit -DskipTests -f
./shenyu-integrated-test/pom.xml
+ else
+ echo "Falling back to maven wrapper for integrated tests"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pit -DskipTests -f
./shenyu-integrated-test/pom.xml
+ else
+ ./mvnw -B clean install -Pit -DskipTests -f
./shenyu-integrated-test/pom.xml
+ fi
+ fi
- name: Start docker compose
if: steps.filter.outputs.integration == 'true'
run: docker compose -f ./shenyu-integrated-test/${{ matrix.case
}}/docker-compose.yml up -d
@@ -109,7 +165,19 @@ jobs:
- name: Run test
id: test
if: steps.filter.outputs.integration == 'true'
- run: ./mvnw test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for running tests"
+ mvnd test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ else
+ echo "Falling back to maven wrapper for tests"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ else
+ ./mvnw test -Pit -f ./shenyu-integrated-test/${{ matrix.case
}}/pom.xml
+ fi
+ fi
continue-on-error: true
- name: Check test result
if: steps.filter.outputs.integration == 'true'
diff --git a/.github/workflows/k8s-examples-http.yml
b/.github/workflows/k8s-examples-http.yml
index 082e36ce36..7f3cb06de7 100644
--- a/.github/workflows/k8s-examples-http.yml
+++ b/.github/workflows/k8s-examples-http.yml
@@ -26,8 +26,7 @@ jobs:
runs-on: ubuntu-latest
if: (github.repository == 'apache/shenyu')
steps:
- -
- uses: actions/checkout@v3
+ - uses: actions/checkout@v3
with:
submodules: true
- name: Free disk space
@@ -39,8 +38,7 @@ jobs:
done
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable
- -
- uses: ./actions/paths-filter
+ - uses: ./actions/paths-filter
id: filter
with:
filters: |
@@ -59,16 +57,14 @@ jobs:
- '!NOTICE'
- '!.github/ISSUE_TEMPLATE/**'
- '!.github/PULL_REQUEST_TEMPLATE'
- -
- name: Install k8s
+ - name: Install k8s
if: steps.filter.outputs.k8s-examples == 'true'
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.6+k3s2
K3S_KUBECONFIG_MODE=777 sh -
cat /etc/rancher/k3s/k3s.yaml
mkdir -p ~/.kube
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
- -
- name: Restore ShenYu Maven Repos
+ - name: Restore ShenYu Maven Repos
if: steps.filter.outputs.k8s-examples == 'true'
uses: actions/cache/restore@v3
with:
@@ -76,22 +72,62 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- -
- uses: actions/setup-java@v4
+ - uses: actions/setup-java@v4
if: steps.filter.outputs.k8s-examples == 'true'
with:
java-version: 17
- distribution: 'temurin'
- -
- name: Build with Maven
+ distribution: "temurin"
+ - name: Install mvnd
if: steps.filter.outputs.k8s-examples == 'true'
- run: ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
- -
- name: Build examples
+ shell: bash
+ run: |
+ MVND_VERSION=1.0.2
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-windows-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-windows-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ else
+ curl -sL
https://downloads.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ unzip -q mvnd.zip
+ mkdir -p $HOME/.local
+ mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
+ echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
+ fi
+ - name: Build with Maven
+ if: steps.filter.outputs.k8s-examples == 'true'
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build"
+ mvnd -B clean install -Prelease,docker -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true
+ else
+ echo "Falling back to maven wrapper"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ else
+ ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ fi
+ fi
+ - name: Build examples
if: steps.filter.outputs.k8s-examples == 'true'
- run: ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -f ./shenyu-examples/pom.xml
- -
- name: Build k8s Cluster
+ shell: bash
+ run: |
+ if mvnd --version > /dev/null 2>&1; then
+ echo "Using mvnd for build examples"
+ mvnd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -f ./shenyu-examples/pom.xml
+ else
+ echo "Falling back to maven wrapper for examples"
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
+ ./mvnw.cmd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -f ./shenyu-examples/pom.xml
+ else
+ ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -f ./shenyu-examples/pom.xml
+ fi
+ fi
+ - name: Build k8s Cluster
if: steps.filter.outputs.k8s-examples == 'true'
run: |
docker save apache/shenyu-admin:latest
apache/shenyu-bootstrap:latest shenyu-examples-http:latest | sudo k3s ctr
images import -
@@ -99,13 +135,11 @@ jobs:
kubectl apply -f
./shenyu-examples/shenyu-examples-http/k8s/shenyu-service.yml
kubectl apply -f
./shenyu-examples/shenyu-examples-http/k8s/shenyu-zookeeper.yml
kubectl apply -f
./shenyu-examples/shenyu-examples-http/k8s/shenyu-examples-http.yml
- -
- name: Wait for k8s Cluster Start up
+ - name: Wait for k8s Cluster Start up
if: steps.filter.outputs.k8s-examples == 'true'
run: |
bash ./shenyu-examples/shenyu-examples-http/k8s/script/healthcheck.sh
- -
- name: Cluster Test after Healthcheck
+ - name: Cluster Test after Healthcheck
if: steps.filter.outputs.k8s-examples == 'true'
run: |
kubectl get all