This is an automated email from the ASF dual-hosted git repository.
Aias00 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 8a18ecab49 infra(ci): run paths-filter once in a dedicated changes job
instead of per matrix runner (#6435)
8a18ecab49 is described below
commit 8a18ecab49ba7b733706108288e815f8436ad68e
Author: Duansg <[email protected]>
AuthorDate: Mon Jul 20 21:34:57 2026 +0800
infra(ci): run paths-filter once in a dedicated changes job instead of per
matrix runner (#6435)
* infra(ci): run paths-filter once in a dedicated changes job instead of
per matrix runner
* infra(ci): run integration tests when workflow definitions change
---
.github/workflows/ci.yml | 69 ++++++++++++-----------
.github/workflows/integrated-test-k8s-ingress.yml | 45 ++++++++-------
.github/workflows/integrated-test.yml | 62 ++++++++++----------
3 files changed, 90 insertions(+), 86 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5d18776c90..680258ec10 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,31 +26,14 @@ concurrency:
cancel-in-progress: true
jobs:
- build:
- strategy:
- matrix:
- java: [17]
- os: [ubuntu-latest, windows-latest]
- include:
- - java: 17
- os: ubuntu-latest
-# - java: 18
-# os: ubuntu-latest
- - java: 19
- os: ubuntu-latest
- - java: 20
- os: ubuntu-latest
- - java: 21
- os: ubuntu-latest
- runs-on: ${{ matrix.os }}
- if: (github.repository == 'apache/shenyu')
+ changes:
+ if: github.repository == 'apache/shenyu'
+ runs-on: ubuntu-latest
+ outputs:
+ code: ${{ steps.filter.outputs.code }}
+ code_files: ${{ steps.filter.outputs.code_files }}
steps:
- - name: Support longpaths
- if: ${{ matrix.os == 'windows-latest'}}
- run: git config --system core.longpaths true
- uses: actions/checkout@v3
- with:
- submodules: true
- uses: ./actions/paths-filter
id: filter
with:
@@ -80,12 +63,37 @@ jobs:
- 'mvnw.cmd'
- '.mvn/**'
- '.github/workflows/**'
+
+ build:
+ needs: changes
+ strategy:
+ matrix:
+ java: [17]
+ os: [ubuntu-latest, windows-latest]
+ include:
+ - java: 17
+ os: ubuntu-latest
+# - java: 18
+# os: ubuntu-latest
+ - java: 19
+ os: ubuntu-latest
+ - java: 20
+ os: ubuntu-latest
+ - java: 21
+ os: ubuntu-latest
+ runs-on: ${{ matrix.os }}
+ if: github.repository == 'apache/shenyu' && needs.changes.outputs.code ==
'true'
+ steps:
+ - name: Support longpaths
+ if: ${{ matrix.os == 'windows-latest'}}
+ run: git config --system core.longpaths true
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
- name: Debug - Show matched files
- if: steps.filter.outputs.code == 'true'
run: |
- echo "Matched files: ${{ steps.filter.outputs.code_files }}"
+ echo "Matched files: ${{ needs.changes.outputs.code_files }}"
- name: Restore ShenYu Maven Repos
- if: steps.filter.outputs.code == 'true'
id: restore-maven-cache
uses: actions/cache/restore@v3
with:
@@ -94,12 +102,10 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- uses: ./actions/setup-java-with-retry
- if: steps.filter.outputs.code == 'true'
with:
java-version: ${{ matrix.java }}
distribution: "temurin"
- name: Install mvnd
- if: steps.filter.outputs.code == 'true'
shell: bash
run: |
MVND_VERSION=1.0.2
@@ -120,12 +126,10 @@ jobs:
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'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -142,7 +146,6 @@ jobs:
- uses: codecov/codecov-action@v1
with:
token: 2760af6a-3405-4882-9e61-04c5176fecfa
- if: steps.filter.outputs.code == 'true'
check-license-header:
name: check-license-header
@@ -162,9 +165,11 @@ jobs:
name: build
if: (github.repository == 'apache/shenyu') && always()
needs:
+ - changes
- build
runs-on: ubuntu-latest
steps:
- name: checking job status
run: |
- [[ "${{ needs.build.result }}" == "success" ]] || exit -1
+ [[ "${{ needs.changes.result }}" == "success" ]] || exit -1
+ [[ "${{ needs.changes.outputs.code }}" != "true" || "${{
needs.build.result }}" == "success" ]] || exit -1
diff --git a/.github/workflows/integrated-test-k8s-ingress.yml
b/.github/workflows/integrated-test-k8s-ingress.yml
index f726c13012..04ec9b2a50 100644
--- a/.github/workflows/integrated-test-k8s-ingress.yml
+++ b/.github/workflows/integrated-test-k8s-ingress.yml
@@ -26,26 +26,19 @@ concurrency:
cancel-in-progress: true
jobs:
- build:
- strategy:
- matrix:
- case:
- - shenyu-integrated-test-k8s-ingress-http
- - shenyu-integrated-test-k8s-ingress-apache-dubbo
- - shenyu-integrated-test-k8s-ingress-websocket
- - shenyu-integrated-test-k8s-ingress-grpc
- runs-on: ubuntu-latest
+ changes:
if: github.repository == 'apache/shenyu'
+ runs-on: ubuntu-latest
+ outputs:
+ k8s_ingress: ${{ steps.filter.outputs['k8s-ingress'] }}
steps:
- uses: actions/checkout@v3
- with:
- submodules: true
-
- uses: ./actions/paths-filter
id: filter
with:
filters: |
k8s-ingress:
+ - '.github/workflows/integrated-test-k8s-ingress.yml'
- 'shenyu-integrated-test-k8s-ingress*/**'
- 'shenyu-*/**'
- 'pom.xml'
@@ -62,8 +55,23 @@ jobs:
- '!.github/ISSUE_TEMPLATE/**'
- '!.github/PULL_REQUEST_TEMPLATE'
+ build:
+ needs: changes
+ strategy:
+ matrix:
+ case:
+ - shenyu-integrated-test-k8s-ingress-http
+ - shenyu-integrated-test-k8s-ingress-apache-dubbo
+ - shenyu-integrated-test-k8s-ingress-websocket
+ - shenyu-integrated-test-k8s-ingress-grpc
+ runs-on: ubuntu-latest
+ if: github.repository == 'apache/shenyu' &&
needs.changes.outputs.k8s_ingress == 'true'
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+
- name: Clean Space
- if: steps.filter.outputs.k8s-ingress == 'true'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
@@ -71,7 +79,6 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: ./actions/setup-java-with-retry
- if: steps.filter.outputs.k8s-ingress == 'true'
with:
java-version: 17
distribution: "temurin"
@@ -85,14 +92,12 @@ jobs:
go-version: 1.17.x
- name: Install k8s
- if: steps.filter.outputs.k8s-ingress == 'true'
run: |
go install sigs.k8s.io/[email protected]
curl -LO
https://storage.googleapis.com/kubernetes-release/release/v1.24.14/bin/linux/amd64/kubectl
&& sudo install kubectl /usr/local/bin/kubectl
kind create cluster --image=kindest/node:v1.21.1
--config=./shenyu-integrated-test/${{ matrix.case }}/deploy/kind-config.yaml
- name: Install mvnd
- if: steps.filter.outputs.k8s-ingress == 'true'
shell: bash
run: |
MVND_VERSION=1.0.2
@@ -104,7 +109,6 @@ jobs:
echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
- name: Build with Maven
- if: steps.filter.outputs.k8s-ingress == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -116,7 +120,6 @@ jobs:
fi
- name: Build integrated tests
- if: steps.filter.outputs.k8s-ingress == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -128,7 +131,6 @@ jobs:
fi
- name: Build examples
- if: steps.filter.outputs.k8s-ingress == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -140,19 +142,16 @@ jobs:
fi
- name: Build k8s Cluster
- if: steps.filter.outputs.k8s-ingress == 'true'
run: bash ./shenyu-integrated-test/${{ matrix.case
}}/script/build_k8s_cluster.sh
- name: Wait for k8s Cluster Start up
id: healthcheck
- if: steps.filter.outputs.k8s-ingress == 'true'
timeout-minutes: 25
run: |
bash ./shenyu-integrated-test/${{ matrix.case
}}/script/healthcheck.sh
- name: Run test
id: test
- if: steps.filter.outputs.k8s-ingress == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -165,7 +164,7 @@ jobs:
continue-on-error: true
- name: Cluster Test after Healthcheck
- if: always() && steps.filter.outputs.k8s-ingress == 'true'
+ if: always()
run: |
echo "----------kubectl get all -o wide----------"
kubectl get all -o wide || true
diff --git a/.github/workflows/integrated-test.yml
b/.github/workflows/integrated-test.yml
index 6036eacc81..be2a0ef762 100644
--- a/.github/workflows/integrated-test.yml
+++ b/.github/workflows/integrated-test.yml
@@ -26,7 +26,37 @@ concurrency:
cancel-in-progress: true
jobs:
+ changes:
+ if: github.repository == 'apache/shenyu'
+ runs-on: ubuntu-latest
+ outputs:
+ integration: ${{ steps.filter.outputs.integration }}
+ steps:
+ - uses: actions/checkout@v3
+ - uses: ./actions/paths-filter
+ id: filter
+ with:
+ filters: |
+ integration:
+ - '.github/workflows/integrated-test.yml'
+ - 'shenyu-integrated-test/**'
+ - 'shenyu-*/**'
+ - 'pom.xml'
+ - '**/pom.xml'
+ - 'shenyu-examples/**'
+ - '!**/*.md'
+ - '!**/*.txt'
+ - '!resources/static/**'
+ - '!.asf.yaml'
+ - '!.gitignore'
+ - '!.licenserc.yaml'
+ - '!LICENSE'
+ - '!NOTICE'
+ - '!.github/ISSUE_TEMPLATE/**'
+ - '!.github/PULL_REQUEST_TEMPLATE'
+
build:
+ needs: changes
strategy:
matrix:
case:
@@ -41,7 +71,7 @@ jobs:
- shenyu-integrated-test-sdk-apache-dubbo
- shenyu-integrated-test-sdk-http
runs-on: ubuntu-latest
- if: (github.repository == 'apache/shenyu')
+ if: github.repository == 'apache/shenyu' &&
needs.changes.outputs.integration == 'true'
steps:
- uses: actions/checkout@v3
with:
@@ -57,28 +87,7 @@ jobs:
done
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable
- - uses: ./actions/paths-filter
- id: filter
- with:
- filters: |
- integration:
- - 'shenyu-integrated-test/**'
- - 'shenyu-*/**'
- - 'pom.xml'
- - '**/pom.xml'
- - 'shenyu-examples/**'
- - '!**/*.md'
- - '!**/*.txt'
- - '!resources/static/**'
- - '!.asf.yaml'
- - '!.gitignore'
- - '!.licenserc.yaml'
- - '!LICENSE'
- - '!NOTICE'
- - '!.github/ISSUE_TEMPLATE/**'
- - '!.github/PULL_REQUEST_TEMPLATE'
- uses: ./actions/setup-java-with-retry
- if: steps.filter.outputs.integration == 'true'
with:
java-version: 17
distribution: "temurin"
@@ -86,7 +95,6 @@ jobs:
cache-dependency-path: |
**/pom.xml
- name: Install mvnd
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
MVND_VERSION=1.0.2
@@ -97,7 +105,6 @@ jobs:
echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
- name: Pre-pull docker base images
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
pull_with_retry() {
@@ -117,7 +124,6 @@ jobs:
pull_with_retry centos:7
pull_with_retry eclipse-temurin:17-centos7
- name: Build with Maven
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -128,7 +134,6 @@ jobs:
./mvnw -B -T 1C clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
fi
- name: Build examples
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -139,7 +144,6 @@ jobs:
./mvnw -B -T 1C clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
fi
- name: Build integrated tests
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -150,17 +154,14 @@ jobs:
./mvnw -B -T 1C clean install -Pit -DskipTests -f
./shenyu-integrated-test/pom.xml
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
- name: Wait for docker compose start up completely
- if: steps.filter.outputs.integration == 'true'
run: bash ./shenyu-integrated-test/${{ matrix.case
}}/script/healthcheck.sh
- name: Disk space info
run: |
df --human-readable
- name: Run test
id: test
- if: steps.filter.outputs.integration == 'true'
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
@@ -172,7 +173,6 @@ jobs:
fi
continue-on-error: true
- name: Check test result
- if: steps.filter.outputs.integration == 'true'
run: |
docker compose -f ./shenyu-integrated-test/${{ matrix.case
}}/docker-compose.yml logs --tail="all"
if [[ ${{steps.test.outcome}} == "failure" ]]; then