Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

name: ci

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

name: "CodeQL"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand Down
210 changes: 69 additions & 141 deletions .github/workflows/e2e-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

name: e2e

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
Expand All @@ -30,15 +34,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Free disk space
run: |
Comment thread
moremind marked this conversation as resolved.
df --human-readable
sudo apt clean
for image in $(docker image ls --all --quiet); do
docker rmi $image
done
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable

- uses: ./actions/paths-filter
id: filter
with:
Expand All @@ -62,12 +58,13 @@ jobs:

build-docker-images:
needs: changes
if: ${{ needs.changes.outputs.e2e == 'true' }}
if: github.repository == 'apache/shenyu' && needs.changes.outputs.e2e == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Free disk space
run: |
df --human-readable
Expand All @@ -84,25 +81,25 @@ jobs:
java-version: "17"
distribution: "temurin"

- name: Restore ShenYu Maven Repos
id: restore-maven-cache
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
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
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

- name: Build with Maven
shell: bash
Expand All @@ -112,48 +109,66 @@ jobs:
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
./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

- name: Build examples with Maven
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"
./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build examples with Maven uses clean install after the main -Prelease,docker build, which will unnecessarily clean/rebuild any -am dependencies and can significantly increase CI time. Consider removing clean here so this step can reuse artifacts from the previous build (or combine the builds if feasible).

Suggested change
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"
./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
mvnd -B 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"
./mvnw -B install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the follow-up example build from clean install to install so it can reuse artifacts produced by the earlier build in the same job.

fi

- name: Save ShenYu Maven Repos
if: steps.restore-maven-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

# - 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: Export base images
run: |
docker save \
apache/shenyu-bootstrap:latest \
apache/shenyu-admin:latest \
> /tmp/shenyu-base-images.tar

- name: Build Docker Image
- name: Export example images
run: |
docker save apache/shenyu-bootstrap:latest > /tmp/apache-shenyu-bootstrap.tar
docker save apache/shenyu-admin:latest > /tmp/apache-shenyu-admin.tar
docker save \
shenyu-examples-http:latest \
shenyu-examples-eureka:latest \
shenyu-examples-springcloud:latest \
shenyu-examples-apache-dubbo-service:latest \
shenyu-examples-sofa:latest \
shenyu-examples-grpc:latest \
shenyu-example-spring-native-websocket:latest \
> /tmp/shenyu-e2e-example-images.tar

- name: Upload base image artifacts
uses: actions/upload-artifact@v4
with:
name: shenyu-base-images
path: /tmp/shenyu-base-images.tar
retention-days: 1

- name: Upload Docker Image Artifacts
- name: Upload example image artifacts
uses: actions/upload-artifact@v4
with:
name: shenyu-images
path: /tmp/apache-shenyu-*.tar
name: shenyu-e2e-example-images
path: /tmp/shenyu-e2e-example-images.tar
retention-days: 1

e2e-storage:
runs-on: ubuntu-latest
needs:
- changes
- build-docker-images
if: (github.repository == 'apache/shenyu' && ${{ needs.changes.outputs.e2e == 'true' }})
# if: (github.repository == 'apache/shenyu')
if: github.repository == 'apache/shenyu' && needs.changes.outputs.e2e == 'true'
strategy:
matrix:
include:
Expand Down Expand Up @@ -182,14 +197,6 @@ 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: Set up JDK 17 for Building ShenYu
uses: actions/setup-java@v4
with:
Expand All @@ -206,38 +213,24 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: shenyu-images
name: shenyu-base-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 load --input /tmp/shenyu/shenyu-base-images.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: 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

e2e-case:
runs-on: ubuntu-latest
needs:
- changes
- build-docker-images
if: (github.repository == 'apache/shenyu' && ${{ needs.changes.outputs.e2e == 'true' }})
# if: (github.repository == 'apache/shenyu')
if: github.repository == 'apache/shenyu' && needs.changes.outputs.e2e == 'true'
strategy:
matrix:
include:
Expand All @@ -261,7 +254,6 @@ jobs:
script: e2e-logging-rocketmq-compose
# - case: shenyu-e2e-case-logging-kafka
# script: e2e-logging-kafka-compose

steps:
- uses: actions/checkout@v2
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job still uses actions/checkout@v2 while other jobs in this workflow use @v3. checkout@v2 is deprecated (Node 12-based) and may start failing as GitHub retires older runtimes; update this to match the newer version used elsewhere (e.g., actions/checkout@v3 or @v4).

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v3

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the e2e-k8s.yml checkout steps to actions/checkout@v4 so this workflow no longer relies on the deprecated v2 action.

with:
Expand All @@ -279,14 +271,6 @@ 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: Set up JDK 17 for Building ShenYu
uses: actions/setup-java@v4
with:
Expand All @@ -301,82 +285,26 @@ jobs:
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
name: shenyu-base-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: Build examples with Maven
shell: bash
run: |
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

- uses: actions/download-artifact@v4
with:
name: shenyu-images
name: shenyu-e2e-example-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 load --input /tmp/shenyu/shenyu-base-images.tar
docker load --input /tmp/shenyu/shenyu-e2e-example-images.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: 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

requirement:
name: e2e
if: ${{ needs.changes.outputs.e2e == 'true' }}
Expand Down
Loading
Loading