forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (101 loc) · 4.68 KB
/
e2e-operation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# 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: E2E - Operation
on:
push:
branches: [ dev ]
pull_request:
workflow_dispatch:
concurrency:
group: e2e-${{ 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
detect-changed-files:
name: Detect Changed Files
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
token: ${{ github.token }}
filters: .github/workflows/resources/filter/filters.yml
outputs:
changed_operations: ${{ steps.filter.outputs.changes }}
e2e-operation:
if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }}
name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }}
needs: [ detect-changed-files, global-environment ]
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
max-parallel: 20
fail-fast: false
matrix:
operation: [ transaction, pipeline, showprocesslist ]
image: [ { type: "it.docker.mysql.version", version: "mysql:5.7" }, { type: "it.docker.postgresql.version", version: "postgres:12-alpine" }, { type: "it.docker.opengauss.version", version: "enmotech/opengauss:2.1.0" } ]
exclude:
- operation: showprocesslist
image: { type: "it.docker.postgresql.version", version: "postgres:12-alpine" }
- operation: showprocesslist
image: { type: "it.docker.opengauss.version", version: "enmotech/opengauss:2.1.0" }
steps:
- env:
changed_operations: ${{ needs.detect-changed-files.outputs.changed_operations }}
current_operation: ${{ matrix.operation }}
name: Check if ${{ matrix.operation }} is Changed
run: |
echo "skip_current_step=false" >> $GITHUB_ENV
if [[ ${changed_operations} == '["ignore"]' ]]; then
echo "${current_operation} is ignored by ignore filter"
echo "skip_current_step=true" >> $GITHUB_ENV
fi
if [[ ${changed_operations} == *""$current_operation""* ]]; then
echo "${current_operation} is detected by changed filter"
else
echo "${current_operation} is ignore by filter"
echo "skip_current_step=true" >> $GITHUB_ENV
fi
- name: Checkout Project
if: (env.skip_current_step == 'false')
uses: actions/checkout@v3
- name: Retrieve Maven Caches
if: (env.skip_current_step == 'false')
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-e2e-cache-${{ github.sha }}
restore-keys: |
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-e2e-cache-
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-
- if: (env.skip_current_step == 'false')
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Build ${{ matrix.operation }} E2E Image
if: (env.skip_current_step == 'false')
run: ./mvnw -B clean install -am -pl test/e2e/operation/${{ matrix.operation }} -Pit.env.docker -DskipTests
- name: Run ${{ matrix.operation }} on ${{ matrix.image.version }}
if: (env.skip_current_step == 'false')
run: ./mvnw -nsu -B install -f test/e2e/operation/${{ matrix.operation }}/pom.xml -D${{ matrix.operation }}.it.env.type=docker -D${{ matrix.operation }}.${{ matrix.image.type }}=${{ matrix.image.version }}