-
Notifications
You must be signed in to change notification settings - Fork 3k
Optimize PR CI by deduplicating heavy workflow setup #6326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
49174a4
da384e7
fa7144e
89df3b5
1d94fb9
0dcf7a5
0a99dbd
122ee19
05457d8
4f10590
0ffa760
f2fb263
1b3deab
8f716f6
09378b7
951b850
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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: | ||||||||||||||||||
|
|
@@ -30,15 +34,7 @@ jobs: | |||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||
| with: | ||||||||||||||||||
| submodules: true | ||||||||||||||||||
| - name: Free disk space | ||||||||||||||||||
| run: | | ||||||||||||||||||
| 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: | ||||||||||||||||||
|
|
@@ -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 | ||||||||||||||||||
|
|
@@ -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 | ||||||||||||||||||
|
|
@@ -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 | ||||||||||||||||||
|
||||||||||||||||||
| 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 |
There was a problem hiding this comment.
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.
Copilot
AI
Apr 15, 2026
There was a problem hiding this comment.
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).
| - uses: actions/checkout@v2 | |
| - uses: actions/checkout@v3 |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.