This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ad69a64b529 Improve e2e-sql.yml : reuse upload/download-e2e-artifacts
composite action (#38287)
ad69a64b529 is described below
commit ad69a64b5294d6b858988fec21e4d32a4ea78dd4
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Sun Mar 1 17:56:01 2026 +0800
Improve e2e-sql.yml : reuse upload/download-e2e-artifacts composite action
(#38287)
* ci(e2e-sql): rename build-e2e-image job to prepare-e2e-artifacts
* ci(e2e-sql): use upload/download-e2e-artifacts composite actions to fix
dependency resolution
---
.github/workflows/e2e-sql.yml | 65 ++++------------------
.../actions/download-e2e-artifacts/action.yml | 7 +++
2 files changed, 18 insertions(+), 54 deletions(-)
diff --git a/.github/workflows/e2e-sql.yml b/.github/workflows/e2e-sql.yml
index 589d889f07e..5c6f754d09f 100644
--- a/.github/workflows/e2e-sql.yml
+++ b/.github/workflows/e2e-sql.yml
@@ -120,8 +120,8 @@ jobs:
echo "need-proxy-image=${{
steps.generate-matrix.outputs.need-proxy-image }}"
echo "filter-json=${{ steps.generate-matrix.outputs.filter-json }}"
- build-e2e-image:
- name: Build E2E Image
+ prepare-e2e-artifacts:
+ name: Prepare E2E Artifacts
if: github.repository == 'apache/shardingsphere' &&
needs.detect-and-generate-matrix.outputs.has-jobs == 'true'
needs: [ global-environment, detect-and-generate-matrix ]
runs-on: ubuntu-latest
@@ -140,25 +140,12 @@ jobs:
with:
cache-hit: ${{ steps.setup-build-environment.outputs.cache-hit }}
cache-primary-key: ${{
steps.setup-build-environment.outputs.cache-primary-key }}
- - name: Package ShardingSphere Maven Repository
- run: tar -czf /tmp/apache-shardingsphere-maven-repo.tar.gz -C
~/.m2/repository org/apache/shardingsphere
- - name: Save E2E Image
- run: docker save -o /tmp/apache-shardingsphere-proxy-test.tar
apache/shardingsphere-proxy-test:latest
- - uses: actions/upload-artifact@v4
- with:
- name: e2e-image
- path: /tmp/apache-shardingsphere-proxy-test.tar
- retention-days: 10
- - uses: actions/upload-artifact@v4
- with:
- name: e2e-maven-repo
- path: /tmp/apache-shardingsphere-maven-repo.tar.gz
- retention-days: 1
+ - uses: ./.github/workflows/resources/actions/upload-e2e-artifacts
e2e-sql-smoke:
name: E2E - SQL (Smoke)
- needs: [ detect-and-generate-matrix, build-e2e-image, global-environment ]
- if: always() && github.repository == 'apache/shardingsphere' &&
needs.detect-and-generate-matrix.outputs.has-jobs == 'true' &&
needs.detect-and-generate-matrix.result == 'success' &&
(needs.build-e2e-image.result == 'success' || needs.build-e2e-image.result ==
'skipped')
+ needs: [ detect-and-generate-matrix, prepare-e2e-artifacts,
global-environment ]
+ if: always() && github.repository == 'apache/shardingsphere' &&
needs.detect-and-generate-matrix.outputs.has-jobs == 'true' &&
needs.detect-and-generate-matrix.result == 'success' &&
(needs.prepare-e2e-artifacts.result == 'success' ||
needs.prepare-e2e-artifacts.result == 'skipped')
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
@@ -172,24 +159,9 @@ jobs:
cache-suffix: 'e2e-sql'
cache-save-enabled: 'false'
enable-docker-setup: 'true'
- - name: Download Maven Repository
- uses: actions/download-artifact@v4
- with:
- name: e2e-maven-repo
- path: /tmp/
- - name: Restore Maven Repository
- run: |
- mkdir -p ~/.m2/repository
- tar -xzf /tmp/apache-shardingsphere-maven-repo.tar.gz -C
~/.m2/repository
- - name: Download E2E Image
- if: matrix.adapter == 'proxy'
- uses: actions/download-artifact@v4
+ - uses: ./.github/workflows/resources/actions/download-e2e-artifacts
with:
- name: e2e-image
- path: /tmp/
- - name: Load E2E Image
- if: matrix.adapter == 'proxy'
- run: docker load -i /tmp/apache-shardingsphere-proxy-test.tar
+ load-docker-image: ${{ matrix.adapter == 'proxy' }}
- name: Run E2E Test
run: ./mvnw -nsu -B install -f test/e2e/sql/pom.xml
-Dspotless.apply.skip=true -De2e.run.type=DOCKER -De2e.artifact.modes=${{
matrix.mode }} -De2e.artifact.adapters=${{ matrix.adapter }}
-De2e.run.additional.cases=false -De2e.scenarios=${{ matrix.scenario }}
-De2e.artifact.databases=${{ matrix.database }} ${{ matrix.additional-options }}
@@ -225,12 +197,12 @@ jobs:
e2e-sql-stage2:
name: E2E - SQL (Stage 2)
- needs: [ detect-remaining-matrix, build-e2e-image, global-environment ]
+ needs: [ detect-remaining-matrix, prepare-e2e-artifacts,
global-environment ]
if: >-
always()
&& github.repository == 'apache/shardingsphere'
&& needs.detect-remaining-matrix.outputs.has-remaining-jobs == 'true'
- && (needs.build-e2e-image.result == 'success' ||
needs.build-e2e-image.result == 'skipped')
+ && (needs.prepare-e2e-artifacts.result == 'success' ||
needs.prepare-e2e-artifacts.result == 'skipped')
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
@@ -244,23 +216,8 @@ jobs:
cache-suffix: 'e2e-sql'
cache-save-enabled: 'false'
enable-docker-setup: 'true'
- - name: Download Maven Repository
- uses: actions/download-artifact@v4
- with:
- name: e2e-maven-repo
- path: /tmp/
- - name: Restore Maven Repository
- run: |
- mkdir -p ~/.m2/repository
- tar -xzf /tmp/apache-shardingsphere-maven-repo.tar.gz -C
~/.m2/repository
- - name: Download E2E Image
- if: matrix.adapter == 'proxy'
- uses: actions/download-artifact@v4
+ - uses: ./.github/workflows/resources/actions/download-e2e-artifacts
with:
- name: e2e-image
- path: /tmp/
- - name: Load E2E Image
- if: matrix.adapter == 'proxy'
- run: docker load -i /tmp/apache-shardingsphere-proxy-test.tar
+ load-docker-image: ${{ matrix.adapter == 'proxy' }}
- name: Run E2E Test
run: ./mvnw -nsu -B install -f test/e2e/sql/pom.xml
-Dspotless.apply.skip=true -De2e.run.type=DOCKER -De2e.artifact.modes=${{
matrix.mode }} -De2e.artifact.adapters=${{ matrix.adapter }}
-De2e.run.additional.cases=false -De2e.scenarios=${{ matrix.scenario }}
-De2e.artifact.databases=${{ matrix.database }} ${{ matrix.additional-options }}
diff --git
a/.github/workflows/resources/actions/download-e2e-artifacts/action.yml
b/.github/workflows/resources/actions/download-e2e-artifacts/action.yml
index f834fef29b9..52bdac7330a 100644
--- a/.github/workflows/resources/actions/download-e2e-artifacts/action.yml
+++ b/.github/workflows/resources/actions/download-e2e-artifacts/action.yml
@@ -18,6 +18,12 @@
name: 'Download E2E Artifacts'
description: 'Download and restore E2E build artifacts including Maven
repository and Docker image'
+inputs:
+ load-docker-image:
+ description: 'Whether to load the Docker image after download'
+ required: false
+ default: 'true'
+
runs:
using: composite
steps:
@@ -32,6 +38,7 @@ runs:
mkdir -p ~/.m2/repository
tar -xzf /tmp/maven-repo-output.tar.gz -C ~/.m2/repository
- name: Load E2E Image
+ if: inputs.load-docker-image == 'true'
shell: bash
run: |
docker load -i /tmp/apache-shardingsphere-proxy-test.tar