Skip to content

Nightly - E2E Operation #832

Nightly - E2E Operation

Nightly - E2E Operation #832

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Nightly - E2E Operation
on:
schedule:
- cron: '0 19 * * 1-5' # Once a day between Monday and Friday. UTC time
workflow_dispatch:
inputs:
operation:
description: 'operation'
required: true
default: '[ "transaction", "pipeline", "showprocesslist" ]'
concurrency:
group: nightly-e2e-operation-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dspotless.apply.skip=true -Dfailsafe.skipAfterFailureCount=1 -Dio.netty.leakDetectionLevel=advanced
jobs:
global-environment:
name: Import Global Environment
uses: ./.github/workflows/required-reusable.yml
prepare-e2e-artifacts:
if: ${{ needs.global-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE == 'true' }}
name: Prepare E2E Artifacts
needs: global-environment
runs-on: ${{ needs.global-environment.outputs.GLOBAL_RUNS_ON }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-java@v5.1.0
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- uses: docker/setup-docker-action@v4
with:
version: v28.0.4
set-host: true
- name: Maven Install
env:
PREFIX: "test/e2e/operation/"
MODULE_LIST: "transaction,pipeline,showprocesslist"
run: |
FORMATTED_PL=$(echo "$MODULE_LIST" | sed "s|,|,$PREFIX|g" | sed "s|^|$PREFIX|")
echo "Ready to build: $FORMATTED_PL"
./mvnw -B clean install -am -pl "$FORMATTED_PL" -Pe2e.env.docker -DskipTests
- name: Package shardingsphere Maven Repository
run: |
tar -czf /tmp/maven-repo-output.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
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-outputs
path: |
/tmp/maven-repo-output.tar.gz
/tmp/apache-shardingsphere-proxy-test.tar
retention-days: 1
e2e-operation-job:
if: ${{ needs.global-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE == 'true' }}
name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }} with JDK ${{ matrix.java-version }}
needs: [ global-environment, prepare-e2e-artifacts ]
runs-on: ${{ needs.global-environment.outputs.GLOBAL_RUNS_ON }}
timeout-minutes: 150
strategy:
max-parallel: 15
fail-fast: false
matrix:
java-version: [ 17, 21 ]
operation: ${{ fromJson(github.event.inputs.operation || '[ "transaction", "pipeline", "showprocesslist" ]') }}
image: [
{ type: "e2e.docker.database.mysql.images", version: "mysql:5.7" },
{ type: "e2e.docker.database.mysql.images", version: "mysql:8.0" },
{ type: "e2e.docker.database.mariadb.images", version: "mariadb:11" },
{ type: "e2e.docker.database.postgresql.images", version: "postgres:11-alpine" },
{ type: "e2e.docker.database.postgresql.images", version: "postgres:12-alpine" },
{ type: "e2e.docker.database.postgresql.images", version: "postgres:13-alpine" },
{ type: "e2e.docker.database.postgresql.images", version: "postgres:14-alpine" },
{ type: "e2e.docker.database.opengauss.images", version: "opengauss/opengauss:3.1.0" }
]
exclude:
- operation: transaction
image: { type: "e2e.docker.database.mariadb.images", version: "mariadb:11" }
- operation: showprocesslist
image: { type: "e2e.docker.database.mariadb.images", version: "mariadb:11" }
- operation: showprocesslist
image: { type: "e2e.docker.database.postgresql.images", version: "postgres:10-alpine,postgres:11-alpine,postgres:12-alpine,postgres:13-alpine,postgres:14-alpine" }
- operation: showprocesslist
image: { type: "e2e.docker.database.opengauss.images", version: "opengauss/opengauss:3.1.0" }
steps:
- uses: actions/checkout@v6.0.1
- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5.1.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'maven'
- uses: docker/setup-docker-action@v4
with:
version: v28.0.4
set-host: true
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-outputs
path: /tmp/
- name: Restore shardingsphere Maven Repository
run: |
mkdir -p ~/.m2/repository
tar -xzf /tmp/maven-repo-output.tar.gz -C ~/.m2/repository
- name: Load E2E Image
run: docker load -i /tmp/apache-shardingsphere-proxy-test.tar
- name: Run ${{ matrix.operation }} on ${{ matrix.image.version }}
run: ./mvnw -nsu -B install -f test/e2e/operation/${{ matrix.operation }}/pom.xml -De2e.run.type=docker -D${{ matrix.image.type }}=${{ matrix.image.version }}